├── LICENSE
├── admin
├── activation.php
├── admin.php
├── assets
│ ├── css
│ │ ├── admin.css
│ │ ├── jquery-ui.min.css
│ │ └── select2.min.css
│ ├── images
│ │ ├── loading.svg
│ │ └── wp-review-pro.jpg
│ └── js
│ │ ├── admin.import.js
│ │ ├── admin.js
│ │ ├── editor-plugin.js
│ │ ├── rating-inputs.js
│ │ ├── review-items.js
│ │ ├── review-notice.js
│ │ ├── select2.min.js
│ │ └── wp-review-tab-widget-admin.js
├── class-wp-review-form-field.php
├── class-wp-review-importer.php
├── class-wp-review-options.php
├── class-wpr-review-notice.php
├── demo-importer.php
├── demo-importer
│ ├── class-wp-import.php
│ ├── class-wp-review-demo-importer.php
│ └── parsers.php
├── font-awesome-icons.php
├── metaboxes.php
├── options
│ ├── facebook.php
│ ├── google.php
│ ├── hello-bar.php
│ ├── help.php
│ ├── import.php
│ ├── multisite.php
│ ├── popup.php
│ ├── review.php
│ ├── role-manager.php
│ └── yelp.php
└── review-options-meta-box.php
├── box-templates
├── aqua.php
├── default.php
└── global
│ └── partials
│ ├── review-links.php
│ └── review-schema.php
├── comments
└── comments.php
├── filter-list.php
├── includes
├── ajax.php
├── comments.php
├── demo
│ └── demo-content.xml
├── enqueue.php
├── functions.php
├── schemas.php
├── shortcodes.php
├── widget.php
└── widgets
│ └── class-wp-review-tab-widget.php
├── languages
└── wp-review.pot
├── public
├── css
│ ├── amp.css
│ ├── font-awesome.min.css
│ ├── magnific-popup.css
│ └── wp-review.css
├── fonts
│ ├── FontAwesome.otf
│ ├── font-icons.eot
│ ├── font-icons.svg
│ ├── font-icons.ttf
│ ├── font-icons.woff
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ └── fontawesome-webfont.woff2
├── images
│ ├── amazon.jpg
│ ├── aqua.jpg
│ ├── blue.jpg
│ ├── darkside.jpg
│ ├── dash.jpg
│ ├── default.jpg
│ ├── edge.jpg
│ ├── enterprise.jpg
│ ├── facebook.jpg
│ ├── fizzy.jpg
│ ├── gamer.jpg
│ ├── gravity.jpg
│ ├── largethumb.png
│ ├── shell.jpg
│ ├── smallthumb.png
│ ├── tabbed.jpg
│ ├── tabbed2.jpg
│ ├── xiaomi.jpg
│ └── zine.jpg
└── js
│ ├── jquery.magnific-popup.min.js
│ ├── js.cookie.min.js
│ ├── main.js
│ └── wp-review-tab-widget.js
├── rating-types
├── circle-input.php
├── circle-output.php
├── percentage-input.js
├── percentage-input.php
├── percentage-output.php
├── point-input.js
├── point-input.php
├── point-output.php
├── star-input.js
├── star-input.php
├── star-output.php
├── thumbs-input.php
└── thumbs-output.php
├── readme.txt
├── template-list.php
└── wp-review.php
/admin/activation.php:
--------------------------------------------------------------------------------
1 | h2{margin-top:0}.wpr-vertical-tabs__content .nav-tab-active{background-color:#fff;border-bottom-color:#fff}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.clearfix{*zoom:1}.wp_review_schema_type_options textarea{width:77%;min-height:80px}.wp-review-field select{width:15em;margin-left:0}.wp-review-field #wp_review_product_price{width:70px}.wp-review-field .wp-color-result{margin:0}.wp-review-field .large-text{width:77%}.wp-review-field input{margin:0;padding:5px 8px}.wp-review-field .wp-picker-container{display:inline-block}.wp-review-field .wp-picker-container label{flex:none;width:auto}.wp-review-field .wp-picker-container input[type="text"].wp-color-picker{padding:4px;width:65px}.wp-review-field .wp-picker-container .iris-picker{box-sizing:initial}.wp-review-field .wp-picker-container .wp-picker-open+.wp-picker-input-wrap{width:140px}#wp-wp_review_pros-wrap textarea.wp-editor-area,#wp-wp_review_cons-wrap textarea.wp-editor-area,#wp-wp_review_desc-wrap textarea.wp-editor-area{border:0}.wp_review_schema_options_label{vertical-align:top;padding-top:5px}.wpr_image_upload_field{display:inline-block}.wp-review-item th{text-align:left}.wp-review-item td:first-child{text-align:center}.wp-review-item .handle{cursor:move}.wp-review-links td:first-child{text-align:center}.wp-review-links .handle{cursor:move}.wp-review-links input[type="text"]{padding:5px 8px}.has-border-bottom{border-bottom:1px solid #ddd;margin-bottom:20px;padding-bottom:20px}.review-total{text-align:right}.wp-review-field-option:not(.pyre_field) .wp-picker-holder{position:absolute;z-index:9}.review-value-incorrect{border-color:#F00 !important}#wp_review_id_hint{margin-left:8px}.wp-review-admin-options .form-table td{padding:20px 10px;vertical-align:top}.wp-review-admin-options p.description{font-weight:normal;font-style:normal}.wp-review-admin-options .wp-review-field>label .description{margin-left:0}.wp-review-admin-options .wp-review-field input{padding:7px;border-radius:2px;margin:0;box-shadow:inset 0 1px 3px rgba(0,0,0,0.1)}.wp-review-admin-options .wp-review-field input[type=radio]{border-radius:50%}.wp-review-admin-options .wp-review-field input[type=checkbox]{border-radius:0}.wp-review-admin-options .wp-review-field .large-text{width:70%}.wp-review-admin-options .wp-review-field .description{display:block;color:#888;font-style:normal;margin-top:5px}.wp-review-admin-options #wp_review_shortcode_hint_field span{display:inline;margin-left:6px}.wp-review-admin-options .wp-review-thumbnail-options label{margin-right:0;width:90%}.wp-review-description label{margin-bottom:-20px;display:block}.wp-review-theme-defaults-msg{position:relative}.wp-review-theme-defaults-msg a.button{display:inline-block;margin-bottom:8px}.wp-review-theme-defaults-msg a.close-notice{position:absolute;top:0;right:0}.edit-ratings-notice.update-nag{background:#fff9e8;margin-right:0}#wp-review-width-slider{width:70%;float:left;margin-top:12px;margin-right:25px;border-radius:0;max-width:600px;border:0;background:#d8d8d8;height:8px}#wp-review-width-slider .ui-slider-handle{background:#fff;box-shadow:0 0px 3px rgba(0,0,0,0.4);border-radius:2px}#wp-review-width-slider.ui-slider-horizontal .ui-slider-range-min{border:0;border-radius:2px;background:#0184bb}#wp_review_width{width:60px}.wrap.wp-review .nav-tab-wrapper{border-bottom:1px solid #ccc;margin-top:16px}.wrap.wp-review .nav-tab-wrapper a:focus{box-shadow:none}.nav-tab-hidden{display:none}.nav-tab-hidden.nav-tab-active{display:block}textarea#wp-review-migrate-log{width:600px;max-width:100%;height:200px;display:none}.already-migrated-msg{display:none}#start-migrate{margin-bottom:12px}#wp-review-settings-tab-contents>div{display:none;max-width:900px}#wp-review-settings-tab-contents .settings-tab-general{display:block}.pros-cons-title{max-width:25%}.column-wp_review_rating,.column-wp_review_comment_rating{text-align:center;position:relative;width:110px}.column-wp_review_rating .review-star,.column-wp_review_comment_rating .review-star{position:relative;letter-spacing:1px}.column-wp_review_rating .no-rating,.column-wp_review_comment_rating .no-rating{color:#aaa;font-style:italic}#editwpreview{overflow:hidden}#editwpreview .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:left}#editwpreview .inside input{width:180px}#editwpreview label{padding:2px 0}h4.wp-review-comment-title{margin-top:0;margin-bottom:1em}.review-result-wrapper{position:relative;display:inline-block;font-size:0}.postbox .review-result-wrapper a,.postbox .review-result i{cursor:pointer}.review-result{position:absolute;top:0;left:0;height:22px;overflow:hidden;white-space:nowrap}.wp-review-rating-feature{display:inline-block}.wp-review-notice{position:relative}.wpr_image_upload_img{margin:0 0 10px;padding:0;max-width:100%;height:auto;float:left;display:inline-block}.wpr-hide{display:none}.wpr-tabs .tab-title.nav-tab-active{background-color:#fff;border-bottom-color:#fff}.wpr-box-template-images{display:flex;flex-wrap:wrap}.wpr-box-template-images .wpr-box-template-image{flex:0 0 50%;display:block;outline:0;box-shadow:none;text-decoration:none;text-align:center;color:#333;font-weight:700;margin-bottom:5px}.wpr-box-template-images .wpr-box-template-image img{padding:4px;width:100%;height:auto;display:block}.wpr-box-template-images .wpr-box-template-image.active img{background-color:#0073aa}#wpr-review-items-app *{box-sizing:border-box}#wpr-review-items-app .wpr-review-item{background-color:#f7f7f7;padding:10px 10px 10px 30px;margin-bottom:5px}#wpr-review-items-app .wpr-review-item .setting-row:first-of-type .col-2 input{width:100%;padding:5px;background:#fff}#wpr-review-items-app .wpr-review-item .col-3 input{float:right;background:#fff}#wpr-review-items-app .wpr-review-item .wpr-icon-move{cursor:move;position:absolute;left:5px;top:16px}#wpr-review-items-app .setting-row{padding:5px 0}#wpr-review-items-app .final-row .col-3{text-align:right}#wpr-review-items-app .final-row .col-3 input{float:right;min-width:52px}#wpr-review-items-app .final-row .col-3 label{margin:4px 10px 0 0;display:inline-block;font-weight:bold}#wpr-review-items-app .wpr-percentage-input-wrapper{margin-top:10px}#wpr-review-items-app .wp-picker-container{display:inline-block}#wpr-review-items-app .wp-picker-holder *{box-sizing:initial}@media (min-width: 768px){#wpr-review-items-app .wpr-review-item{position:relative}#wpr-review-items-app .delete-item{position:absolute;right:10px;bottom:10px}#wpr-review-items-app .setting-row{display:flex;flex-wrap:wrap}#wpr-review-items-app .col-1{flex:0 0 20%}#wpr-review-items-app .col-2{flex:0 0 60%;padding:0 10px}#wpr-review-items-app .col-3{flex:0 0 20%}}#wp_review_box_template_wrapper{position:relative}#wp_review_box_template_preview{position:absolute;left:250px;top:0px;z-index:1000;padding:3px;box-shadow:0 0 3px rgba(0,0,0,0.2);background:#fff}#wp_review_box_template_preview.loading{background:#eee url(../images/loading.svg) no-repeat center center}#wp_review_box_template_preview.loading img{visibility:hidden}#wp_review_box_template_img,#wp_review_box_template_preview_img{max-width:414px;height:auto}.wpr-switch{display:inline-block}.wpr-switch input{position:absolute !important;clip:rect(0, 0, 0, 0);height:1px;width:1px;border:0;overflow:hidden}.wpr-switch label{float:left;display:inline-block;min-width:45px;background-color:#e4e4e4;color:rgba(0,0,0,0.6);font-size:12px;font-weight:700;line-height:28px;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,0.2);box-shadow:inset 0 1px 3px rgba(0,0,0,0.3),0 1px rgba(255,255,255,0.1);transition:all 0.1s ease-in-out}.wpr-switch label:hover{cursor:pointer}.wpr-switch label:first-of-type{border-radius:3px 0 0 3px;border-right:0;font-weight:normal}.wpr-switch label:last-of-type{border-radius:0 3px 3px 0;border-left:0;font-weight:normal}input.wpr-switch__on:checked+label,input.wpr-switch__off:checked+label{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;margin-bottom:2px}input.wpr-switch__on:checked+label:hover,input.wpr-switch__off:checked+label:hover{background:#008ec2;border-color:#006799;color:#fff}input.wpr-switch__off:checked+label,input.wpr-switch__off:checked+label:hover{color:#fff;background:#f5786f;border-color:#bd4c44 #bd4c44 #bd4c44;box-shadow:0 1px 0 #bd4c44;text-shadow:none}#wp-review-demo-importer-popup{background:#fff;border:1px solid #eaeaeb;border-radius:3px;box-shadow:0 1px 0 #fff inset,0 1px 5px rgba(0,0,0,0.1);position:relative;width:auto;max-width:600px;margin:50px auto}#wp-review-demo-importer-modal-header{border-bottom:1px solid #eaeaeb;background:#FAFBFD;padding:12px 20px}#wp-review-demo-importer-modal-header .spinner{margin-top:14px}#wp-review-demo-importer-modal-header h2,#wp-review-demo-importer-modal-content h4{padding:0 !important;margin:0 !important}#wp-review-demo-importer-modal-header h2{font-size:1.8em;line-height:2em}#wp-review-demo-importer-modal-content{background:#fff;padding:20px;overflow:auto;height:300px;width:100%;box-sizing:border-box}#wp-review-demo-importer-modal-content p{padding:0;margin:0}#wp-review-demo-importer-modal-footer{border-top:1px solid #eaeaeb;background:#FAFBFD;padding:12px 20px;display:inline-block;width:100%;box-sizing:border-box}#wp-review-demo-importer-modal-footer-info{float:left}#wp-review-demo-importer-modal-footer-button{float:right;display:none;text-transform:uppercase}.wp-admin select.mce-selectbox{padding:0}#wp-review-metabox-userReview .inside>p:first-of-type label,#wp-review-metabox-userReview .inside>p:nth-of-type(2) label,#wp-review-metabox-userReview .inside>p:nth-of-type(3) label,#wp-review-metabox-userReview .inside>p:nth-of-type(4) label{padding-right:0;margin-left:5px}.wp-review-subsite-wrapper{display:none}.wp-review-pro-text{color:#00cc66}.wp-review-disabled{position:relative;cursor:pointer}.wp-review-disabled:before{content:" ";display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:100}.wp-review-disabled.inline-block{display:inline-block}.wp-review-disabled.wpr-switch,.wp-review-disabled.has-bg{opacity:0.3}option.disabled{color:#aaa}
2 |
--------------------------------------------------------------------------------
/admin/assets/css/jquery-ui.min.css:
--------------------------------------------------------------------------------
1 | /*---------------------------
2 | * jQuery UI Slider
3 | *--------------------------*/
4 | .ui-slider { position: relative; text-align: left; }
5 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.3em; cursor: default; }
6 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
7 | .ui-slider-horizontal { height: .8em; }
8 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
9 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
10 | .ui-slider-horizontal .ui-slider-range-min { left: 0; }
11 | .ui-slider-horizontal .ui-slider-range-max { right: 0; }
12 | .ui-slider-vertical { width: .8em; height: 100px; }
13 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
14 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
15 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
16 | .ui-slider-vertical .ui-slider-range-max { top: 0; }
17 |
18 | /* Date Picker Default Styles */
19 | .ui-datepicker {
20 | padding: 0;
21 | margin: 0;
22 | -webkit-border-radius: 0;
23 | -moz-border-radius: 0;
24 | border-radius: 0;
25 | background-color: #fff;
26 | border: 1px solid #dfdfdf;
27 | border-top: none;
28 | -webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
29 | box-shadow: 0 3px 6px rgba(0, 0, 0, 0.075);
30 | min-width: 17em;
31 | width: auto;
32 | }
33 |
34 | .ui-datepicker * {
35 | padding: 0;
36 | font-family: "Open Sans", sans-serif;
37 | -webkit-border-radius: 0;
38 | -moz-border-radius: 0;
39 | border-radius: 0;
40 | }
41 |
42 | .ui-datepicker table {
43 | font-size: 13px;
44 | margin: 0;
45 | border: none;
46 | border-collapse: collapse;
47 | }
48 |
49 | .ui-datepicker .ui-widget-header,
50 | .ui-datepicker .ui-datepicker-header {
51 | background-image: none;
52 | border: none;
53 | color: #fff;
54 | font-weight: normal;
55 | }
56 |
57 | .ui-datepicker .ui-datepicker-header .ui-state-hover {
58 | background: transparent;
59 | border-color: transparent;
60 | cursor: pointer;
61 | }
62 |
63 | .ui-datepicker .ui-datepicker-title {
64 | margin: 0;
65 | padding: 10px 0;
66 | color: #fff;
67 | font-size: 14px;
68 | line-height: 14px;
69 | text-align: center;
70 | }
71 |
72 | .ui-datepicker .ui-datepicker-prev,
73 | .ui-datepicker .ui-datepicker-next {
74 | position: relative;
75 | top: 0;
76 | height: 34px;
77 | width: 34px;
78 | }
79 |
80 | .ui-datepicker .ui-state-hover.ui-datepicker-prev,
81 | .ui-datepicker .ui-state-hover.ui-datepicker-next {
82 | border: none;
83 | }
84 |
85 | .ui-datepicker .ui-datepicker-prev,
86 | .ui-datepicker .ui-datepicker-prev-hover {
87 | left: 0;
88 | }
89 |
90 | .ui-datepicker .ui-datepicker-next,
91 | .ui-datepicker .ui-datepicker-next-hover {
92 | right: 0;
93 | }
94 |
95 | .ui-datepicker .ui-datepicker-next span,
96 | .ui-datepicker .ui-datepicker-prev span {
97 | display: none;
98 | }
99 |
100 | .ui-datepicker .ui-datepicker-prev {
101 | float: left;
102 | }
103 |
104 | .ui-datepicker .ui-datepicker-next {
105 | float: right;
106 | }
107 |
108 | .ui-datepicker .ui-datepicker-prev:before,
109 | .ui-datepicker .ui-datepicker-next:before {
110 | font: normal 20px/34px 'dashicons';
111 | padding-left: 7px;
112 | color: #fff;
113 | speak: none;
114 | -webkit-font-smoothing: antialiased;
115 | -moz-osx-font-smoothing: grayscale;
116 | width: 34px;
117 | height: 34px;
118 | }
119 |
120 | .ui-datepicker .ui-datepicker-prev:before {
121 | content: '\f341';
122 | }
123 |
124 | .ui-datepicker .ui-datepicker-next:before {
125 | content: '\f345';
126 | }
127 |
128 | .ui-datepicker .ui-datepicker-prev-hover:before,
129 | .ui-datepicker .ui-datepicker-next-hover:before {
130 | opacity: 0.7;
131 | }
132 |
133 | .ui-datepicker select.ui-datepicker-month,
134 | .ui-datepicker select.ui-datepicker-year {
135 | width: 33%;
136 | }
137 |
138 | .ui-datepicker thead {
139 | color: #fff;
140 | font-weight: 600;
141 | }
142 |
143 | .ui-datepicker th {
144 | padding: 10px;
145 | }
146 |
147 | .ui-datepicker td {
148 | padding: 0;
149 | border: 1px solid #f4f4f4;
150 | }
151 |
152 | .ui-datepicker td.ui-datepicker-other-month {
153 | border: transparent;
154 | }
155 |
156 | .ui-datepicker td.ui-datepicker-week-end {
157 | background-color: #f4f4f4;
158 | border: 1px solid #f4f4f4;
159 | }
160 |
161 | .ui-datepicker td.ui-datepicker-today {
162 | background-color: #f0f0c0;
163 | }
164 |
165 | .ui-datepicker td.ui-datepicker-current-day {
166 | background: #bbdd88;
167 | }
168 |
169 | .ui-datepicker td .ui-state-default {
170 | background: transparent;
171 | border: none;
172 | text-align: center;
173 | text-decoration: none;
174 | width: auto;
175 | display: block;
176 | padding: 5px 10px;
177 | font-weight: normal;
178 | color: #444;
179 | }
180 |
181 | .ui-datepicker td.ui-state-disabled .ui-state-default {
182 | opacity: 0.5;
183 | }
184 |
185 | /* Default Color Scheme */
186 | .ui-datepicker .ui-widget-header,
187 | .ui-datepicker .ui-datepicker-header {
188 | background: #00a0d2;
189 | }
190 |
191 | .ui-datepicker thead {
192 | background: #32373c;
193 | }
194 |
195 | .ui-datepicker td .ui-state-hover {
196 | background: #0073aa;
197 | color: #fff;
198 | }
199 |
200 | /* WordPress Color Schemes */
201 |
202 | /* Fresh */
203 | .admin-color-fresh .ui-datepicker .ui-widget-header,
204 | .admin-color-fresh .ui-datepicker .ui-datepicker-header {
205 | background: #00a0d2;
206 | }
207 |
208 | .admin-color-fresh .ui-datepicker thead {
209 | background: #32373c;
210 | }
211 |
212 | .admin-color-fresh .ui-datepicker td .ui-state-hover {
213 | background: #0073aa;
214 | color: #fff;
215 | }
216 |
217 | /* Blue */
218 | .admin-color-blue .ui-datepicker .ui-widget-header,
219 | .admin-color-blue .ui-datepicker .ui-datepicker-header {
220 | background: #52accc;
221 | }
222 |
223 | .admin-color-blue .ui-datepicker thead {
224 | background: #4796b3;
225 | }
226 |
227 | .admin-color-blue .ui-datepicker td .ui-state-hover {
228 | background: #096484;
229 | color: #fff;
230 | }
231 |
232 | /* Coffee */
233 | .admin-color-coffee .ui-datepicker .ui-widget-header,
234 | .admin-color-coffee .ui-datepicker .ui-datepicker-header {
235 | background: #59524c;
236 | }
237 |
238 | .admin-color-coffee .ui-datepicker thead {
239 | background: #46403c;
240 | }
241 |
242 | .admin-color-coffee .ui-datepicker td .ui-state-hover {
243 | background: #c7a589;
244 | color: #fff;
245 | }
246 |
247 | /* Ectoplasm */
248 | .admin-color-ectoplasm .ui-datepicker .ui-widget-header,
249 | .admin-color-ectoplasm .ui-datepicker .ui-datepicker-header {
250 | background: #523f6d;
251 | }
252 |
253 | .admin-color-ectoplasm .ui-datepicker thead {
254 | background: #413256;
255 | }
256 |
257 | .admin-color-ectoplasm .ui-datepicker td .ui-state-hover {
258 | background: #a3b745;
259 | color: #fff;
260 | }
261 |
262 | /* Midnight */
263 | .admin-color-midnight .ui-datepicker .ui-widget-header,
264 | .admin-color-midnight .ui-datepicker .ui-datepicker-header {
265 | background: #363b3f;
266 | }
267 |
268 | .admin-color-midnight .ui-datepicker thead {
269 | background: #26292c;
270 | }
271 |
272 | .admin-color-midnight .ui-datepicker td .ui-state-hover {
273 | background: #e14d43;
274 | color: #fff;
275 | }
276 |
277 | /* Ocean */
278 | .admin-color-ocean .ui-datepicker .ui-widget-header,
279 | .admin-color-ocean .ui-datepicker .ui-datepicker-header {
280 | background: #738e96;
281 | }
282 |
283 | .admin-color-ocean .ui-datepicker thead {
284 | background: #627c83;
285 | }
286 |
287 | .admin-color-ocean .ui-datepicker td .ui-state-hover {
288 | background: #9ebaa0;
289 | color: #fff;
290 | }
291 |
292 | /* Sunrise */
293 | .admin-color-sunrise .ui-datepicker .ui-widget-header,
294 | .admin-color-sunrise .ui-datepicker .ui-datepicker-header,
295 | .admin-color-sunrise .ui-datepicker .ui-datepicker-header .ui-state-hover {
296 | background: #cf4944;
297 | }
298 |
299 | .admin-color-sunrise .ui-datepicker th {
300 | border-color: #be3631;
301 | background: #be3631;
302 | }
303 |
304 | .admin-color-sunrise .ui-datepicker td .ui-state-hover {
305 | background: #dd823b;
306 | color: #fff;
307 | }
308 |
309 | /* Light */
310 | .admin-color-light .ui-datepicker .ui-widget-header,
311 | .admin-color-light .ui-datepicker .ui-datepicker-header {
312 | background: #e5e5e5;
313 | }
314 |
315 | .admin-color-light .ui-datepicker thead {
316 | background: #888;
317 | }
318 |
319 | .admin-color-light .ui-datepicker .ui-datepicker-title,
320 | .admin-color-light .ui-datepicker td .ui-state-default,
321 | .admin-color-light .ui-datepicker .ui-datepicker-prev:before,
322 | .admin-color-light .ui-datepicker .ui-datepicker-next:before {
323 | color: #555;
324 | }
325 |
326 | .admin-color-light .ui-datepicker td .ui-state-hover {
327 | background: #e5e5e5;
328 | }
329 |
330 | /* bbPress Color Schemes */
331 |
332 | /* Evergreen */
333 | .admin-color-bbp-evergreen .ui-datepicker .ui-widget-header,
334 | .admin-color-bbp-evergreen .ui-datepicker .ui-datepicker-header {
335 | background: #56b274;
336 | }
337 |
338 | .admin-color-bbp-evergreen .ui-datepicker thead {
339 | background: #36533f;
340 | }
341 |
342 | .admin-color-bbp-evergreen .ui-datepicker td .ui-state-hover {
343 | background: #446950;
344 | color: #fff;
345 | }
346 |
347 | /* Mint */
348 | .admin-color-bbp-mint .ui-datepicker .ui-widget-header,
349 | .admin-color-bbp-mint .ui-datepicker .ui-datepicker-header {
350 | background: #4ca26a;
351 | }
352 |
353 | .admin-color-bbp-mint .ui-datepicker thead {
354 | background: #4f6d59;
355 | }
356 |
357 | .admin-color-bbp-mint .ui-datepicker td .ui-state-hover {
358 | background: #5fb37c;
359 | color: #fff;
360 | }
--------------------------------------------------------------------------------
/admin/assets/images/loading.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/admin/assets/images/wp-review-pro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/admin/assets/images/wp-review-pro.jpg
--------------------------------------------------------------------------------
/admin/assets/js/admin.import.js:
--------------------------------------------------------------------------------
1 | jQuery( function( $ ) {
2 | 'use strict';
3 |
4 | var $section_header = $( '#import h2' );
5 | var default_error = { message: wprImportVars.server_error };
6 | var source, nonce;
7 |
8 | $( '#wp-review-import-options-btn' ).on( 'click', function( ev ) {
9 | ev.preventDefault();
10 | var $btn, code, check;
11 | $btn = $( this );
12 | code = $( '#wp-review-import-options-code' ).val().trim();
13 | if ( ! code ) {
14 | return;
15 | }
16 | check = confirm( wprImportVars.confirmOptionsImport );
17 | if ( ! check ) {
18 | return;
19 | }
20 | $btn.prop( 'disabled', true );
21 | var request = wp.ajax.post( 'wp_review_import_options', {
22 | code: code,
23 | _ajax_nonce: wprImportVars.importOptionsNonce
24 | });
25 | request.done( function( response ) {
26 | window.location.href = window.location.href;
27 | });
28 | request.fail( function( response ) {
29 | console.error( response );
30 | $btn.prop( 'disabled', false );
31 | });
32 | });
33 | } );
34 |
--------------------------------------------------------------------------------
/admin/assets/js/editor-plugin.js:
--------------------------------------------------------------------------------
1 | ( function( tinymce, wpreview, $ ) {
2 | "use strict";
3 |
4 | var getShortcode = function( name, attrs ) {
5 | var output = '[' + name;
6 | for ( var k in attrs ) {
7 | if ( ! attrs[ k ] ) {
8 | continue;
9 | }
10 | output += ' ' + k + '="' + attrs[ k ] + '"';
11 | }
12 | output += ']';
13 | return output;
14 | };
15 |
16 | function getWPReviewButton( editor ) {
17 | return {
18 | text: wprVars.reviewBox,
19 | onclick: function() {
20 | var dialog = editor.windowManager.open({
21 | title: wprVars.reviewBox,
22 | body: [
23 | {
24 | type: 'textbox',
25 | name: 'id',
26 | label: wprVars.reviewId,
27 | tooltip: wprVars.leaveReviewIdEmpty
28 | }
29 | ],
30 | buttons: [
31 | {
32 | id: 'wpr-insert-shortcode',
33 | classes: 'widget btn primary first abs-layout-item',
34 | text: wprVars.insert,
35 | onclick: function() {
36 | dialog.submit();
37 | }
38 | },
39 | {
40 | id: 'wpr-cancel-shortcode',
41 | text: wprVars.cancel,
42 | onclick: function() {
43 | dialog.close();
44 | }
45 | }
46 | ],
47 | onsubmit: function( e ) {
48 | var name = 'wp-review',
49 | attrs = e.data;
50 |
51 | editor.insertContent( getShortcode( name, attrs ) );
52 | }
53 | });
54 | }
55 | };
56 | }
57 |
58 | function getReviewTotalButton( editor ) {
59 | return {
60 | text: wprVars.reviewTotal,
61 | onclick: function() {
62 | var dialog = editor.windowManager.open({
63 | title: wprVars.reviewTotal,
64 | body: [
65 | {
66 | type: 'textbox',
67 | name: 'id',
68 | label: wprVars.reviewId,
69 | tooltip: wprVars.leaveReviewIdEmpty
70 | }
71 | ],
72 | buttons: [
73 | {
74 | id: 'wpr-insert-shortcode',
75 | classes: 'widget btn primary first abs-layout-item',
76 | text: wprVars.insert,
77 | onclick: function() {
78 | dialog.submit();
79 | }
80 | },
81 | {
82 | id: 'wpr-cancel-shortcode',
83 | text: wprVars.cancel,
84 | onclick: function() {
85 | dialog.close();
86 | }
87 | }
88 | ],
89 | onsubmit: function( e ) {
90 | var name = 'wp-review-total',
91 | attrs = e.data;
92 |
93 | editor.insertContent( getShortcode( name, attrs ) );
94 | }
95 | });
96 | }
97 | };
98 | }
99 |
100 | function getVisitorRatingButton( editor ) {
101 | return {
102 | text: wprVars.visitorRating,
103 | onclick: function() {
104 | var dialog = editor.windowManager.open({
105 | title: wprVars.visitorRating,
106 | body: [
107 | {
108 | type: 'textbox',
109 | name: 'id',
110 | label: wprVars.reviewId,
111 | tooltip: wprVars.leaveReviewIdEmpty
112 | }
113 | ],
114 | buttons: [
115 | {
116 | id: 'wpr-insert-shortcode',
117 | classes: 'widget btn primary first abs-layout-item',
118 | text: wprVars.insert,
119 | onclick: function() {
120 | dialog.submit();
121 | }
122 | },
123 | {
124 | id: 'wpr-cancel-shortcode',
125 | text: wprVars.cancel,
126 | onclick: function() {
127 | dialog.close();
128 | }
129 | }
130 | ],
131 | onsubmit: function( e ) {
132 | var name = 'wp-review-visitor-rating',
133 | attrs = e.data;
134 |
135 | editor.insertContent( getShortcode( name, attrs ) );
136 | }
137 | });
138 | }
139 | };
140 | }
141 |
142 | tinymce.create( 'tinymce.plugins.WPReviewPro', {
143 | /**
144 | * Initializes the plugin, this will be executed after the plugin has been created.
145 | * This call is done before the editor instance has finished it's initialization so use the onInit event
146 | * of the editor instance to intercept that event.
147 | *
148 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
149 | * @param {string} url Absolute URL to where the plugin is located.
150 | */
151 | init : function( ed, url ) {
152 | ed.addButton( 'wpreviewpro', {
153 | type: 'menubutton',
154 | icon: 'dashicons dashicons-before dashicons-star-filled',
155 | menu: [
156 | getWPReviewButton( ed ),
157 | getReviewTotalButton( ed ),
158 | getVisitorRatingButton( ed )
159 | ]
160 | });
161 | },
162 |
163 | /**
164 | * Creates control instances based in the incomming name. This method is normally not
165 | * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
166 | * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
167 | * method can be used to create those.
168 | *
169 | * @param {String} n Name of the control to create.
170 | * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
171 | * @return {tinymce.ui.Control} New control instance or null if no control was created.
172 | */
173 | createControl : function(n, cm) {
174 | return null;
175 | },
176 |
177 | /**
178 | * Returns information about the plugin as a name/value array.
179 | * The current keys are longname, author, authorurl, infourl and version.
180 | *
181 | * @return {Object} Name/value array containing information about the plugin.
182 | */
183 | getInfo : function() {
184 | return {
185 | longname : 'WP Review Buttons',
186 | author : 'MTS',
187 | authorurl : 'https://mythemeshop.com',
188 | version : '3.0.0'
189 | };
190 | }
191 | });
192 |
193 | // Register plugin
194 | tinymce.PluginManager.add( 'wp_review', tinymce.plugins.WPReviewPro );
195 | })( tinymce, wpreview, jQuery );
196 |
--------------------------------------------------------------------------------
/admin/assets/js/rating-inputs.js:
--------------------------------------------------------------------------------
1 | ( function( $ ) {
2 | "use strict";
3 |
4 | var defaults = {
5 | value: 0,
6 | color: '',
7 | callback: null
8 | };
9 |
10 | function triggerCallback( options, value ) {
11 | if ( typeof options.callback == 'function' ) {
12 | options.callback.call( options._this, value );
13 | }
14 | }
15 |
16 | // Star input.
17 | $.fn.wprStarInput = function( method ) {
18 | var methods = {
19 | init: function( options ) {
20 | var _this = this, wrapper, html, starHtml, width;
21 | options = $.extend( {}, defaults, this.data(), options );
22 | if ( this.val() ) {
23 | options.value = this.val() ? parseFloat( this.val() ) : 0;
24 | }
25 | options._this = this;
26 |
27 | width = parseFloat( options.value ) * 20;
28 |
29 | starHtml = '';
30 | for ( var i = 0; i < 5; i++ ) {
31 | starHtml += '';
32 | }
33 |
34 | html = '
';
38 |
39 | wrapper = $( html );
40 | this.before( wrapper );
41 |
42 | if ( typeof options.ready == 'function' ) {
43 | options.ready.call( this, wrapper, options )
44 | }
45 |
46 | wrapper.on( 'mousemove', function( ev ) {
47 | var newWidth;
48 | newWidth = ev.pageX - $( this ).offset().left;
49 | newWidth = newWidth / $( this ).width() * 100;
50 | newWidth = Math.ceil( newWidth / 10 ) * 10;
51 | $( this ).attr( 'data-value', newWidth / 20 ); // width / 100 * 5
52 | $( this ).find( '.stars-result' ).css( 'width', newWidth + '%' );
53 | $( this ).attr( 'data-width', newWidth );
54 | }).on( 'mouseleave', function() {
55 | // Reset to old width.
56 | $( this ).find( '.stars-result' ).css( 'width', width + '%' );
57 | $( this ).attr( 'data-width', width );
58 | $( this ).attr( 'data-value', options.value );
59 | }).on( 'click', function() {
60 | width = $( this ).attr( 'data-width' );
61 | options.value = parseFloat( $( this ).attr( 'data-value' ) );
62 | _this.val( options.value );
63 | triggerCallback( options, options.value );
64 | });
65 |
66 | wrapper.css({ color: options.color });
67 |
68 | this.on( 'change', function() {
69 | var value = $( this ).val() ? parseFloat( $( this ).val() ) : 0;
70 | wrapper.attr( 'data-value', value );
71 | wrapper.attr( 'data-width', value * 20 );
72 | wrapper.find( '.stars-result' ).css( 'width', ( value * 20 ) + '%' );
73 | triggerCallback( options, value );
74 | });
75 | }
76 | };
77 |
78 | if ( ! method || typeof method == 'object' ) {
79 | methods.init.apply( this, arguments );
80 | return;
81 | }
82 | if ( methods[ method ] ) {
83 | methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
84 | return;
85 | }
86 | };
87 |
88 | // Percentage input.
89 | $.fn.wprPercentageInput = function( method ) {
90 | var methods = {
91 | init: function( options ) {
92 | var _this = this, wrapper;
93 | options = $.extend( {}, defaults, this.data(), options );
94 | if ( this.val() ) {
95 | options.value = this.val();
96 | }
97 | options._this = this;
98 |
99 | if ( ! options.inactiveColor ) {
100 | options.inactiveColor = '#ccc';
101 | }
102 |
103 | wrapper = $( '' );
104 | this.before( wrapper );
105 |
106 | if ( typeof options.ready == 'function' ) {
107 | options.ready.call( this, wrapper, options )
108 | }
109 |
110 | wrapper.slider({
111 | min: 0,
112 | max: 100,
113 | step: 1,
114 | range: 'min',
115 | value: options.value,
116 | create: function( ev, ui ) {
117 | wrapper.css( 'backgroundColor', options.inactiveColor );
118 | wrapper.find( '.ui-slider-range' ).css( 'backgroundColor', options.color );
119 | },
120 | slide: function( ev, ui ) {
121 | triggerCallback( options, ui.value );
122 | }
123 | });
124 |
125 | this.on( 'change', function() {
126 | var value = $( this ).val();
127 | wrapper.slider( 'value', value );
128 | triggerCallback( options, value );
129 | });
130 | }
131 | };
132 |
133 | if ( ! method || typeof method == 'object' ) {
134 | methods.init.apply( this, arguments );
135 | return;
136 | }
137 | if ( methods[ method ] ) {
138 | methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
139 | return;
140 | }
141 | };
142 |
143 | // Point input.
144 | $.fn.wprPointInput = function( method ) {
145 | var methods = {
146 | init: function( options ) {
147 | var _this = this, wrapper;
148 | options = $.extend( {}, defaults, this.data(), options );
149 | if ( this.val() ) {
150 | options.value = this.val();
151 | }
152 | options._this = this;
153 |
154 | if ( ! options.inactiveColor ) {
155 | options.inactiveColor = '#ccc';
156 | }
157 |
158 | wrapper = $( '' );
159 | this.before( wrapper );
160 |
161 | if ( typeof options.ready == 'function' ) {
162 | options.ready.call( this, wrapper, options )
163 | }
164 |
165 | wrapper.slider({
166 | min: 0,
167 | max: 10,
168 | step: 0.1,
169 | range: 'min',
170 | value: options.value,
171 | create: function( ev, ui ) {
172 | wrapper.css( 'backgroundColor', options.inactiveColor );
173 | wrapper.find( '.ui-slider-range' ).css( 'backgroundColor', options.color );
174 | },
175 | slide: function( ev, ui ) {
176 | triggerCallback( options, ui.value );
177 | }
178 | });
179 |
180 | this.on( 'change', function() {
181 | var value = $( this ).val();
182 | wrapper.slider( 'value', value );
183 | triggerCallback( options, value );
184 | });
185 | }
186 | };
187 |
188 | if ( ! method || typeof method == 'object' ) {
189 | methods.init.apply( this, arguments );
190 | return;
191 | }
192 | if ( methods[ method ] ) {
193 | methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
194 | return;
195 | }
196 | };
197 |
198 | })( jQuery );
199 |
--------------------------------------------------------------------------------
/admin/assets/js/review-items.js:
--------------------------------------------------------------------------------
1 | ( function( Backbone, $ ) {
2 | "use strict";
3 |
4 | if ( ! $( '#wpr-review-items-app' ).length ) {
5 | return;
6 | }
7 |
8 | var App = {
9 | Models: {},
10 | Collections: {},
11 | Views: {}
12 | };
13 |
14 | App.Models.Item = Backbone.Model.extend({
15 | defaults: function() {
16 | return {
17 | id: '',
18 | item_id: '',
19 | wp_review_item_title: '',
20 | wp_review_item_star: 0,
21 | wp_review_item_color: $( '#wpr-review-color-value' ).val(),
22 | wp_review_item_inactive_color: $( '#wpr-review-inactive-color-value' ).val(),
23 | type: $( '#wpr-review-type-2' ).val() || wprVars.globalReviewType
24 | };
25 | }
26 | });
27 |
28 | App.Collections.Items = Backbone.Collection.extend({
29 | model: App.Models.Item
30 | });
31 |
32 | App.Views.ItemView = Backbone.View.extend({
33 | template: wp.template( 'wpr-review-item' ),
34 |
35 | className: 'wpr-review-item',
36 |
37 | initialize: function() {
38 | this.model.on( 'destroy', this.remove, this );
39 | },
40 |
41 | events: {
42 | 'click .delete-item': 'remove',
43 | 'change .input-title': 'changeTitle',
44 | 'change .input-star': 'changeScore'
45 | },
46 |
47 | render: function() {
48 | var _this = this,
49 | data;
50 |
51 | data = this.model.toJSON();
52 | data.itemNameSetting = wp.template( 'wpr-review-item-name' )( data );
53 | data.itemColorSetting = wp.template( 'wpr-review-item-color' )( data );
54 | data.itemInactiveColorSetting = wp.template( 'wpr-review-item-inactive-color' )( data );
55 | if ( $( '#tmpl-wpr-review-item-' + data.type + '-rating' ).length ) {
56 | data.itemRatingSetting = wp.template( 'wpr-review-item-' + data.type + '-rating' )( data );
57 | } else {
58 | data.itemRatingSetting = wp.template( 'wpr-review-item-rating' )( data );
59 | }
60 | this.$el.html( this.template( data ) );
61 |
62 | this.$( '.input-color' ).wpColorPicker({
63 | change: function( ev, ui ) {
64 | var color = ui.color.toString();
65 | _this.$( '.wpr-star-input-wrapper' ).css({ color: color });
66 | _this.$( '.wpr-input-wrapper.ui-slider .ui-slider-range' ).css({ backgroundColor: color });
67 | _this.model.set( 'wp_review_item_color', color );
68 | }
69 | });
70 |
71 | this.$( '.input-inactive-color' ).wpColorPicker({
72 | change: function( ev, ui ) {
73 | var color = ui.color.toString();
74 | _this.$( '.wpr-star-input-wrapper .stars-bg' ).css({ color: color });
75 | _this.$( '.wpr-input-wrapper.ui-slider' ).css({ backgroundColor: color });
76 | _this.model.set( 'wp_review_item_inactive_color', color );
77 | }
78 | });
79 |
80 | function validateValue( value, min, max ) {
81 | value = parseFloat( value );
82 | if ( isNaN( value ) || min !== undefined && value < min || max !== undefined && value > max ) {
83 | _this.$el.find( '.input-star, .input-star-display' ).addClass( 'review-value-incorrect' );
84 | } else {
85 | _this.$el.find( '.input-star, .input-star-display' ).removeClass( 'review-value-incorrect' );
86 | }
87 | }
88 |
89 | switch ( this.model.get( 'type' ) ) {
90 | case 'star':
91 | var _this = this;
92 |
93 | this.$( '.input-star' ).wprStarInput({
94 | ready: function( wrapper, options ) {
95 | this.appendTo( this.closest( '.col-2' ).next() );
96 | },
97 | callback: function( value ) {
98 | validateValue( value, 0, wprVars.reviewTypes.star.max );
99 | _this.model.set( 'wp_review_item_star', value );
100 | }
101 | });
102 | break;
103 |
104 | case 'percentage':
105 | this.$( '.input-star' ).wprPercentageInput({
106 | ready: function( wrapper, options ) {
107 | this.appendTo( this.closest( '.col-2' ).next() );
108 | },
109 | callback: function( value ) {
110 | this.val( value );
111 | validateValue( value, 0, wprVars.reviewTypes.percentage.max );
112 | _this.model.set( 'wp_review_item_star', value );
113 | }
114 | });
115 | break;
116 |
117 | case 'point':
118 | this.$( '.input-star' ).wprPointInput({
119 | ready: function( wrapper, options ) {
120 | this.appendTo( this.closest( '.col-2' ).next() );
121 | },
122 | callback: function( value ) {
123 | this.val( value );
124 | validateValue( value, 0, wprVars.reviewTypes.point.max );
125 | _this.model.set( 'wp_review_item_star', value );
126 | }
127 | });
128 | break;
129 | }
130 |
131 | this.$el.attr( 'data-id', this.model.get( 'id' ) );
132 | return this;
133 | },
134 |
135 | remove: function() {
136 | collection.remove( this.model );
137 | },
138 |
139 | changeTitle: function( ev ) {
140 | this.model.set( 'wp_review_item_title', ev.target.value );
141 | },
142 |
143 | changeScore: function( ev ) {
144 | this.model.set( 'wp_review_item_star', parseFloat( ev.target.value ) );
145 | }
146 | });
147 |
148 | App.Views.AppView = Backbone.View.extend({
149 | el: '#wpr-review-items-app',
150 |
151 | initialize: function() {
152 | this.render();
153 | this.collection.on( 'add', this.renderOne, this );
154 | this.collection.on( 'remove', this.remove, this );
155 | this.collection.on( 'add', this.calculateTotal, this );
156 | this.collection.on( 'change', this.calculateTotal, this );
157 | this.collection.on( 'remove', this.calculateTotal, this );
158 | this.collection.on( 'add change remove', this.updateAppAttr, this );
159 | },
160 |
161 | events: {
162 | 'click .add-item': 'addItem',
163 | 'change #wpr-review-type-2': 'changeType'
164 | },
165 |
166 | render: function() {
167 | this.$( '.wpr-review-items' ).html( '' );
168 | this.collection.each( this.renderOne, this );
169 | this.calculateTotal();
170 | this.$( '.wpr-review-items' ).sortable({
171 | handle: '.wpr-icon-move'
172 | });
173 | return this;
174 | },
175 |
176 | renderOne: function( item ) {
177 | var view = new App.Views.ItemView({ model: item });
178 | this.$( '.wpr-review-items' ).append( view.render().el );
179 | },
180 |
181 | calculateTotal: function() {
182 | if ( ! this.$el.attr( 'data-changed' ) ) {
183 | return;
184 | }
185 |
186 | var total = 0,
187 | count = this.collection.length;
188 |
189 | if ( count ) {
190 | _.each( this.collection.models, function( item ) {
191 | total += ! isNaN( item.get( 'wp_review_item_star' ) ) ? parseFloat( item.get( 'wp_review_item_star' ) * 1 ) : 0;
192 | });
193 | total = Math.round( total * 100 / count ) / 100;
194 | }
195 |
196 | this.$( '.input-total' ).val( total );
197 | },
198 |
199 | remove: function( item ) {
200 | this.$el.find( '.wpr-review-item[data-id="' + item.get( 'id' ) + '"]' ).remove();
201 | },
202 |
203 | addItem: function() {
204 | var model = new App.Models.Item();
205 | model.set( 'id', 'a' + parseInt( Math.random() * 100 ) );
206 | this.collection.add( model );
207 | },
208 |
209 | changeType: function( ev ) {
210 | var type = ev.target.value;
211 | if ( type == 'none' ) {
212 | return;
213 | }
214 | _.each( this.collection.models, function( item ) {
215 | item.set( 'type', type );
216 | });
217 | this.render();
218 | },
219 |
220 | updateAppAttr: function() {
221 | this.$el.attr( 'data-changed', '1' );
222 | }
223 | });
224 |
225 | function onSelectType() {
226 | $( '#wpr-review-type-2' ).val( $( this ).val() ).trigger( 'change' );
227 | }
228 | $( '#wp_review_type' ).on( 'change', onSelectType );
229 |
230 | // App initialize.
231 | var items = $( '#wpr-review-items-data' ).val();
232 | items = items ? JSON.parse( items ) : [];
233 | items.map( function( item, index ) {
234 | item.item_id = item.id;
235 | item.id = index;
236 | return item;
237 | });
238 |
239 | var collection = new App.Collections.Items( items );
240 |
241 | var appView = new App.Views.AppView({
242 | collection: collection
243 | });
244 | })( Backbone, jQuery );
245 |
--------------------------------------------------------------------------------
/admin/assets/js/review-notice.js:
--------------------------------------------------------------------------------
1 | ( function( $ ) {
2 | "use strict";
3 |
4 | function dismiss( later ) {
5 | $.post(
6 | ajaxurl,
7 | {
8 | action: 'wpr_dismiss_review_notice',
9 | later: later
10 | },
11 | function( response ) {
12 | $( '#wpr-review-notice' ).remove();
13 | }
14 | )
15 | }
16 |
17 | $( document ).ready( function() {
18 | $( '.wpr-review-notice-btn-dismiss, #wpr-review-notice .notice-dismiss' ).on( 'click', function() {
19 | dismiss();
20 | });
21 | $( '.wpr-review-notice-btn-later' ).on( 'click', function() {
22 | dismiss( true );
23 | });
24 | });
25 | })( jQuery );
26 |
--------------------------------------------------------------------------------
/admin/assets/js/wp-review-tab-widget-admin.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Plugin Name: WP Review
3 | * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4 | * Description: Create reviews! Choose from Stars, Percentages, Circles or Points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5 | * Author: MyThemesShop
6 | * Author URI: http://mythemeshop.com/
7 | */
8 | jQuery(document).on('click', function(e) {
9 | var $this = jQuery(e.target);
10 | var $form = $this.closest('.wp_review_tab_options_form');
11 |
12 | if ($this.is('.wp_review_tab_enable_toprated')) {
13 | $form.find('.wp_review_tab_toprated_order').slideToggle($this.is(':checked'));
14 | $form.find('.wp_review_tab_toprated_title').slideToggle($this.is(':checked'));
15 | $form.find('.wp_review_tab_top_rated_filter').slideToggle($this.is(':checked'));
16 | } else if ($this.is('.wp_review_tab_enable_recent')) {
17 | $form.find('.wp_review_tab_recent_order').slideToggle($this.is(':checked'));
18 | $form.find('.wp_review_tab_recent_title').slideToggle($this.is(':checked'));
19 | } else if ($this.is('.wp_review_tab_enable_mostvoted')) {
20 | $form.find('.wp_review_tab_mostvoted_order').slideToggle($this.is(':checked'));
21 | $form.find('.wp_review_tab_mostvoted_title').slideToggle($this.is(':checked'));
22 | } else if ($this.is('.wp_review_tab_enable_recent_ratings')) {
23 | $form.find('.wp_review_tab_recent_ratings_order').slideToggle($this.is(':checked'));
24 | $form.find('.wp_review_tab_recent_ratings_title').slideToggle($this.is(':checked'));
25 | $form.find('.wp_review_restrict_recent_review').slideToggle($this.is(':checked'));
26 | } else if ($this.is('.wp_review_tab_enable_custom')) {
27 | $form.find('.wp_review_tab_custom_order').slideToggle($this.is(':checked'));
28 | $form.find('.wp_review_tab_custom_title').slideToggle($this.is(':checked'));
29 | $form.find('.wp_review_tab_custom_reviews').slideToggle($this.is(':checked'));
30 | } else if ($this.is('.wp_review_tab_order_header')) {
31 | e.preventDefault();
32 | $form.find('.wp_review_tab_order').slideToggle();
33 | $form.find('.wp_review_tab_titles').slideUp();
34 | } else if ($this.is('.wp_review_tab_titles_header')) {
35 | e.preventDefault();
36 | $form.find('.wp_review_tab_titles').slideToggle();
37 | $form.find('.wp_review_tab_order').slideUp();
38 | }
39 | });
40 |
--------------------------------------------------------------------------------
/admin/class-wp-review-form-field.php:
--------------------------------------------------------------------------------
1 | '',
25 | 'class' => '',
26 | 'name' => '',
27 | 'on_label' => _x( 'Yes', 'switch label', 'wp-review' ),
28 | 'off_label' => _x( 'No', 'switch label', 'wp-review' ),
29 | 'value' => 0,
30 | 'echo' => true,
31 | 'disabled' => false,
32 | )
33 | );
34 |
35 | $switch_id = $args['id'] ? $args['id'] : 'wpr-switch-' . mt_rand( 100, 999 );
36 | $switch_name = $args['name'] ? $args['name'] : $switch_id;
37 | $value = intval( $args['value'] );
38 |
39 | if ( $args['disabled'] ) {
40 | $args['class'] .= ' wp-review-disabled';
41 | }
42 | ob_start();
43 | ?>
44 |
45 | >
46 |
47 | >
48 |
49 |
50 | numposts = apply_filters( 'wp_review_import_numposts', 10 );
30 | }
31 |
32 | /**
33 | * AJAX handler for importing options.
34 | */
35 | public function import_options() {
36 | check_ajax_referer( 'wp-review-import-options' );
37 | if ( empty( $_POST['code'] ) ) {
38 | wp_send_json_error();
39 | }
40 | $code = wp_unslash( $_POST['code'] );
41 | if ( wp_review_import_options( $code ) ) {
42 | wp_send_json_success();
43 | }
44 | wp_send_json_error();
45 | }
46 |
47 | /**
48 | * Runs extra tasks.
49 | */
50 | public function extra_tasks() {
51 | if ( ! function_exists( 'Display_Select_Review' ) ) {
52 | add_shortcode( 'select-review', '__return_empty_string' );
53 | }
54 | }
55 | }
56 |
57 | $plugin_importer = new WP_Review_Importer();
58 |
--------------------------------------------------------------------------------
/admin/class-wp-review-options.php:
--------------------------------------------------------------------------------
1 | hook = add_options_page(
38 | __( 'WP Review', 'wp-review' ),
39 | __( 'WP Review', 'wp-review' ),
40 | 'wp_review_global_options',
41 | 'wp-review/admin/options.php',
42 | array( $this, 'render' )
43 | );
44 |
45 | add_action( "load-{$this->hook}", array( $this, 'load' ) );
46 | }
47 |
48 | }
49 |
50 | /**
51 | * Runs some functions on page load.
52 | */
53 | public function load() {
54 | add_filter( 'admin_body_class', array( $this, 'admin_body_classes' ) );
55 | }
56 |
57 | /**
58 | * Adds classes to body tag.
59 | *
60 | * @param string $classes Body classes.
61 | * @return string
62 | */
63 | public function admin_body_classes( $classes ) {
64 | $classes .= ' wp-review-admin-options';
65 | return $classes;
66 | }
67 |
68 | /**
69 | * Registers settings.
70 | */
71 | public function register_settings() {
72 | register_setting( 'wpreview-settings-group', 'wp_review_options' );
73 | }
74 |
75 | /**
76 | * Gets options page tabs.
77 | *
78 | * @return array
79 | */
80 | protected function get_tabs() {
81 | $tabs_content = array(
82 | 'review' => array(
83 | 'title' => __( 'Global', 'wp-review' ),
84 | 'icon' => 'cogs',
85 | 'capability' => 'wp_review_global_options',
86 | 'multisite_enabled' => 'hide_global_options_',
87 | ),
88 | 'popup' => array(
89 | 'title' => __( 'Popup', 'wp-review' ),
90 | 'icon' => 'sticky-note',
91 | 'capability' => 'manage_options',
92 | 'multisite_enabled' => 'hide_general_popup_',
93 | ),
94 | 'hello-bar' => array(
95 | 'title' => __( 'Notification Bar', 'wp-review' ),
96 | 'icon' => 'warning',
97 | 'capability' => 'manage_options',
98 | 'multisite_enabled' => 'hide_general_bar_',
99 | ),
100 | 'yelp' => array(
101 | 'title' => __( 'Yelp Reviews', 'wp-review' ),
102 | 'icon' => 'yelp',
103 | 'capability' => 'manage_options',
104 | 'multisite_enabled' => 'hide_yelp_reviews_',
105 | ),
106 | 'google' => array(
107 | 'title' => __( 'Google Reviews', 'wp-review' ),
108 | 'icon' => 'google',
109 | 'capability' => 'manage_options',
110 | 'multisite_enabled' => 'hide_google_reviews_',
111 | ),
112 | 'facebook' => array(
113 | 'title' => __( 'Facebook Reviews', 'wp-review' ),
114 | 'icon' => 'facebook',
115 | 'capability' => 'manage_options',
116 | 'multisite_enabled' => 'hide_facebook_reviews_',
117 | ),
118 | 'role-manager' => array(
119 | 'title' => __( 'Role Manager', 'wp-review' ),
120 | 'icon' => 'user',
121 | 'capability' => 'administrator',
122 | 'multisite_enabled' => 'hide_role_manager_',
123 | ),
124 | 'import' => array(
125 | 'title' => __( 'Import Reviews', 'wp-review' ),
126 | 'icon' => 'download',
127 | 'capability' => 'wp_review_import_reviews',
128 | 'multisite_enabled' => 'hide_import_',
129 | ),
130 | 'help' => array(
131 | 'title' => __( 'Help', 'wp-review' ),
132 | 'icon' => 'question-circle',
133 | 'capability' => 'manage_options',
134 | 'multisite_enabled' => 'hide_help_',
135 | ),
136 | );
137 |
138 | $tabs = array();
139 |
140 | foreach ( $tabs_content as $key => $tab ) {
141 | $hide = wp_review_network_option( $tab['multisite_enabled'] );
142 | if ( current_user_can( $tab['capability'] ) && ! $hide ) {
143 | $tabs[] = array(
144 | 'id' => $key,
145 | 'title' => $tab['title'],
146 | 'icon' => 'fa fa-' . $tab['icon'],
147 | 'view' => WP_REVIEW_ADMIN . 'options/' . $key . '.php',
148 | );
149 | }
150 | }
151 |
152 | if ( is_multisite() && is_main_site() && current_user_can( 'administrator' ) ) {
153 | $tabs[] = array(
154 | 'id' => 'multisite_settings',
155 | 'title' => __( 'Multisite Settings', 'wp-review' ),
156 | 'icon' => 'fa fa-sitemap',
157 | 'view' => WP_REVIEW_ADMIN . 'options/multisite.php',
158 | );
159 | }
160 | return $tabs;
161 | }
162 |
163 | /**
164 | * Renders page content.
165 | */
166 | public function render() {
167 | $tabs = $this->get_tabs();
168 | ?>
169 |
195 | init();
201 |
--------------------------------------------------------------------------------
/admin/class-wpr-review-notice.php:
--------------------------------------------------------------------------------
1 | = this value.
31 | *
32 | * @var int
33 | */
34 | private $review_count = 10;
35 |
36 | /**
37 | * Initializes class.
38 | */
39 | public function init() {
40 | add_action( 'admin_notices', array( $this, 'show_notice' ) );
41 | add_action( 'wp_ajax_wpr_dismiss_review_notice', array( $this, 'handle_dismiss' ) );
42 | }
43 |
44 | /**
45 | * Shows the notice.
46 | */
47 | public function show_notice() {
48 | if ( ! $this->should_show() ) {
49 | return;
50 | }
51 | ?>
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
63 |
67 |
68 |
69 |
70 |
109 | dismiss_later_key, time() + MONTH_IN_SECONDS );
120 | } else {
121 | update_option( $this->dismiss_key, '1' );
122 | }
123 | }
124 |
125 | /**
126 | * Checks if should show the notice.
127 | */
128 | private function should_show() {
129 |
130 | if ( get_option( $this->dismiss_key ) ) {
131 | return false;
132 | }
133 |
134 | $later_date = absint( get_option( $this->dismiss_later_key ) );
135 | if ( $later_date > time() ) {
136 | return false;
137 | }
138 |
139 | // Backwards compatibility for transients used in versions <= 5.2.5
140 | if ( get_transient( 'wpr_review_notice_dismiss' ) ) {
141 | update_option( $this->dismiss_key, '1' );
142 | return false;
143 | }
144 |
145 | $query = wp_review_get_reviews_query(
146 | 'latest',
147 | array(
148 | 'post_num' => $this->review_count,
149 | 'post_status' => 'any',
150 | )
151 | );
152 | return intval( $query->post_count ) === $this->review_count;
153 | }
154 | }
155 |
156 | $review_notice = new WPR_Review_Notice();
157 | $review_notice->init();
158 |
--------------------------------------------------------------------------------
/admin/demo-importer.php:
--------------------------------------------------------------------------------
1 | import( $file );
22 | }
23 |
24 | /**
25 | * Prints demo importer popup.
26 | */
27 | function wp_review_print_demo_importer_popup() {
28 | ?>
29 |
42 | import( $file );
26 | remove_filter( 'wp_import_post_data_processed', array( $this, 'filter_post_data' ) );
27 | }
28 |
29 | /**
30 | * Filters post data before inserting.
31 | *
32 | * @param array $post_data Post data.
33 | * @return array
34 | */
35 | public function filter_post_data( $post_data ) {
36 | if ( 'attachment' !== $post_data['post_type'] ) {
37 | $post_data['post_status'] = 'draft';
38 | }
39 | return $post_data;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/admin/options/facebook.php:
--------------------------------------------------------------------------------
1 |
9 |
10 | ' . esc_html__( 'Click here', 'wp-review' ) . ''
15 | );
16 | ?>
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/admin/options/google.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ' . esc_html__( 'Click here', 'wp-review' ) . ''
27 | );
28 | ?>
29 |
30 |
31 |
--------------------------------------------------------------------------------
/admin/options/hello-bar.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | render_switch(
27 | array(
28 | 'id' => 'wp_review_hello_bar_enable',
29 | 'name' => 'wp_review_hello_bar[enable]',
30 | 'disabled' => true,
31 | )
32 | );
33 | ?>
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | render_switch(
107 | array(
108 | 'id' => 'wp_review_hello_bar_target_blank',
109 | 'name' => 'wp_review_hello_bar[target_blank]',
110 | 'disabled' => true,
111 | )
112 | );
113 | ?>
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
--------------------------------------------------------------------------------
/admin/options/help.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | FREE: ', 'wp-review' ); ?>
14 | https://mythemeshop.com/#signup
15 |
16 |
17 |
18 | https://mythemeshop.com/wordpress-101/
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/admin/options/import.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
36 |
37 |
38 | 'disabled' ) ); ?>
39 |
40 |
41 |
42 | %1$s: %2$s ',
45 | esc_html__( 'Warning', 'wp-review' ),
46 | esc_html__( 'This action is IRREVERSIBLE! Take a backup of your database before proceeding.', 'wp-review' )
47 | );
48 | ?>
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
79 |
80 |
--------------------------------------------------------------------------------
/admin/options/multisite.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
32 |
33 |
34 |
35 | blog_id ) ) {
38 | $hide_options = wp_review_option( 'hide_global_options_' . $site->blog_id );
39 | $hide_role_manager = wp_review_option( 'hide_role_manager_' . $site->blog_id );
40 | $hide_import = wp_review_option( 'hide_import_' . $site->blog_id );
41 | ?>
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | render_switch(
52 | array(
53 | 'id' => 'wp_review_show_global_options_' . $site->blog_id,
54 | 'name' => 'wp_review_options[hide_global_options_' . $site->blog_id . ']',
55 | 'value' => ! empty( $hide_options ),
56 | )
57 | );
58 | ?>
59 |
60 |
61 |
62 |
>
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | render_switch(
73 | array(
74 | 'id' => 'wp_review_hide_general_popup_' . $site->blog_id,
75 | 'name' => 'wp_review_options[hide_general_popup_' . $site->blog_id . ']',
76 | 'disabled' => true,
77 | )
78 | );
79 | ?>
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | render_switch(
92 | array(
93 | 'id' => 'wp_review_hide_general_bar_' . $site->blog_id,
94 | 'name' => 'wp_review_options[hide_general_bar_' . $site->blog_id . ']',
95 | 'disabled' => true,
96 | )
97 | );
98 | ?>
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | render_switch(
111 | array(
112 | 'id' => 'wp_review_hide_yelp_reviews_' . $site->blog_id,
113 | 'name' => 'wp_review_options[hide_yelp_reviews_' . $site->blog_id . ']',
114 | 'disabled' => true,
115 | )
116 | );
117 | ?>
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 | render_switch(
130 | array(
131 | 'id' => 'wp_review_hide_facebook_reviews_' . $site->blog_id,
132 | 'name' => 'wp_review_options[hide_facebook_reviews_' . $site->blog_id . ']',
133 | 'disabled' => true,
134 | )
135 | );
136 | ?>
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 | render_switch(
149 | array(
150 | 'id' => 'wp_review_hide_google_reviews_' . $site->blog_id,
151 | 'name' => 'wp_review_options[hide_google_reviews_' . $site->blog_id . ']',
152 | 'disabled' => true,
153 | )
154 | );
155 | ?>
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | render_switch(
167 | array(
168 | 'id' => 'wp_review_hide_role_manager_' . $site->blog_id,
169 | 'name' => 'wp_review_options[hide_role_manager_' . $site->blog_id . ']',
170 | 'value' => ! empty( $hide_role_manager ),
171 | )
172 | );
173 | ?>
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 | render_switch(
185 | array(
186 | 'id' => 'wp_review_hide_import_' . $site->blog_id,
187 | 'name' => 'wp_review_options[hide_import_' . $site->blog_id . ']',
188 | 'value' => ! empty( $hide_import ),
189 | )
190 | );
191 | ?>
192 |
193 |
194 |
195 |
196 |
197 |
198 | blog_id );
200 |
201 | $hide_review_links = wp_review_option( 'hide_review_links_' . $site->blog_id );
202 | $hide_user_reviews = wp_review_option( 'hide_user_reviews_' . $site->blog_id );
203 | ?>
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 | render_switch(
213 | array(
214 | 'id' => 'wp_review_hide_ratings_in_posts_' . $site->blog_id,
215 | 'name' => 'wp_review_options[hide_ratings_in_posts_' . $site->blog_id . ']',
216 | 'value' => ! empty( $hide_in_posts ),
217 | )
218 | );
219 | ?>
220 |
221 |
222 |
223 |
224 |
225 |
>
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | render_switch(
236 | array(
237 | 'id' => 'wp_review_hide_popup_box__' . $site->blog_id,
238 | 'name' => 'wp_review_options[hide_popup_box_' . $site->blog_id . ']',
239 | 'disabled' => true,
240 | )
241 | );
242 | ?>
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 | render_switch(
255 | array(
256 | 'id' => 'wp_review_hide_notification_bar__' . $site->blog_id,
257 | 'name' => 'wp_review_options[hide_notification_bar_' . $site->blog_id . ']',
258 | 'disabled' => true,
259 | )
260 | );
261 | ?>
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | render_switch(
274 | array(
275 | 'id' => 'wp_review_hide_features__' . $site->blog_id,
276 | 'name' => 'wp_review_options[hide_features_' . $site->blog_id . ']',
277 | 'disabled' => true,
278 | )
279 | );
280 | ?>
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 | render_switch(
292 | array(
293 | 'id' => 'wp_review_hide_review_links__' . $site->blog_id,
294 | 'name' => 'wp_review_options[hide_review_links_' . $site->blog_id . ']',
295 | 'value' => ! empty( $hide_review_links ),
296 | )
297 | );
298 | ?>
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 | render_switch(
311 | array(
312 | 'id' => 'wp_review_hide_review_description__' . $site->blog_id,
313 | 'name' => 'wp_review_options[hide_review_description_' . $site->blog_id . ']',
314 | 'disabled' => true,
315 | )
316 | );
317 | ?>
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 | render_switch(
329 | array(
330 | 'id' => 'wp_review_hide_user_reviews__' . $site->blog_id,
331 | 'name' => 'wp_review_options[hide_user_reviews_' . $site->blog_id . ']',
332 | 'value' => ! empty( $hide_user_reviews ),
333 | )
334 | );
335 | ?>
336 |
337 |
338 |
339 |
340 |
341 |
342 |
345 |
--------------------------------------------------------------------------------
/admin/options/popup.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | render_switch(
18 | array(
19 | 'id' => 'wp_review_popup_enable',
20 | 'name' => 'wp_review_popup[enable]',
21 | 'disabled' => true,
22 | )
23 | );
24 | ?>
25 |
26 |
27 |
28 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
241 |
242 |
243 |
244 |
245 |
246 |
251 |
252 |
253 |
254 |
255 |
256 |
267 |
268 |
269 |
270 |
275 |
--------------------------------------------------------------------------------
/admin/options/role-manager.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 | $role ) {
15 | $role_caps = $role['capabilities'];
16 | ?>
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | $capability ) {
27 | $checked = isset( $role_caps[ $cap ] ) ? 'checked="checked"' : '';
28 | ?>
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/admin/options/yelp.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ' . esc_html__( 'Click here', 'wp-review' ) . ''
28 | );
29 | ?>
30 |
31 |
32 |
--------------------------------------------------------------------------------
/admin/review-options-meta-box.php:
--------------------------------------------------------------------------------
1 | ID, 'wp_review_type', true );
23 | if ( '' === $type_post_value ) {
24 | // Default value when create post.
25 | $type_post_value = wp_review_option( 'review_type', 'none' );
26 | }
27 | $type = $type_post_value;
28 |
29 | $schema = wp_review_get_review_schema( $post->ID );
30 | $schema_data = get_post_meta( $post->ID, 'wp_review_schema_options', true );
31 |
32 | $heading = get_post_meta( $post->ID, 'wp_review_heading', true );
33 | // $available_types = apply_filters('wp_review_metabox_types', wp_review_get_review_types() );
34 | $available_types = wp_review_get_rating_types();
35 | $schemas = wp_review_schema_types();
36 |
37 | $rating_schema = wp_review_get_rating_schema( $post->ID );
38 | $custom_author = get_post_meta( $post->ID, 'wp_review_custom_author', true );
39 | $author = get_post_meta( $post->ID, 'wp_review_author', true );
40 |
41 | $form_field = new WP_Review_Form_Field();
42 | ?>
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
79 |
80 |
81 |
82 | ' . intval( $post->ID ) . '' );
85 | ?>
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
113 |
114 |
115 |
116 |
>
117 |
118 | $arr ) : ?>
119 |
>
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
142 |
143 |
144 |
145 |
>
146 |
147 |
148 |
149 |
150 |
151 |
152 | render_switch(
154 | array(
155 | 'id' => 'wp_review_custom_author',
156 | 'name' => 'wp_review_custom_author',
157 | 'value' => $custom_author,
158 | )
159 | );
160 | ?>
161 |
162 |
163 |
164 |
>
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | render_switch(
188 | array(
189 | 'id' => 'wp_review_show_schema_data',
190 | 'name' => 'wp_review_show_schema_data',
191 | 'disabled' => true,
192 | )
193 | );
194 | ?>
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | render_switch(
208 | array(
209 | 'id' => 'wp_review_enable_embed',
210 | 'name' => 'wp_review_enable_embed',
211 | 'disabled' => true,
212 | )
213 | );
214 | ?>
215 |
216 |
217 |
218 |
219 |
220 |
221 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
33 |
34 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | '',
61 | 'wp_review_item_title' => '',
62 | 'wp_review_item_color' => '',
63 | 'wp_review_item_inactive_color' => '',
64 | ) );
65 | $value_text = '';
66 | if ( 'star' != $review['type'] ) {
67 | $value_text = ' - ' . sprintf( $rating_types[ $review['type'] ]['value_text'], $item['wp_review_item_star'] ) . '';
68 | }
69 | ?>
70 | -
71 | $item['wp_review_item_color'],
77 | 'inactive_color' => $item['wp_review_item_inactive_color'],
78 | )
79 | );
80 | ?>
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
95 |
96 | true,
99 | 'class' => 'review-total',
100 | ) );
101 | endif; ?>
102 |
103 |
104 |
105 |
106 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
125 |
126 | ( )
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
140 |
188 | tag).
200 | * @param int $post_id Current post ID.
201 | * @param array $colors Color data.
202 | */
203 | $color_output = apply_filters( 'wp_review_box_template_default_style', $color_output, $review['post_id'], $colors );
204 |
205 | echo $color_output;
206 |
207 | // Schema json-dl.
208 | echo wp_review_get_schema( $review );
209 | // phpcs:enable
210 |
--------------------------------------------------------------------------------
/box-templates/global/partials/review-links.php:
--------------------------------------------------------------------------------
1 |
15 |
16 | '',
22 | 'text' => '',
23 | )
24 | );
25 |
26 | if ( empty( $review_link['text'] ) ) {
27 | continue;
28 | }
29 | ?>
30 | -
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/box-templates/global/partials/review-schema.php:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 | $data ) {
25 | if ( ! empty( $data['omit'] ) || empty( $schema_data[ $data['name'] ] ) ) {
26 | continue;
27 | }
28 |
29 | if ( ! empty( $data['multiline'] ) ) {
30 | $reviewed_item_data .= '
' . $data['label'] . ': ' . preg_replace( '/\r\n|[\r\n]/', ', ', $schema_data[ $data['name'] ] ) . '
';
31 | continue;
32 | }
33 |
34 | if ( 'image' === $data['name'] && ! isset( $data['part_of'] ) ) {
35 |
36 | if ( ! empty( $schema_data['image']['id'] ) ) {
37 | $image = wp_get_attachment_image( $schema_data['image']['id'], apply_filters( 'wp_review_item_reviewed_image_size', 'medium' ) );
38 | }
39 | continue;
40 | }
41 |
42 | if ( 'image' === $data['type'] ) {
43 | $reviewed_item_data .= '
' . $data['label'] . ': ' . wp_get_attachment_image( $schema_data[ $data['name'] ]['id'] ) . '
';
44 | continue;
45 | }
46 |
47 | if ( 'url' === $data['name'] && ! isset( $data['part_of'] ) ) {
48 | if ( ! empty( $schema_data['url'] ) ) {
49 | $more_text = ! empty( $schema_data['more_text'] ) ? $schema_data['more_text'] : __( '[ More ]', 'wp-review' );
50 | $link = '
' . esc_html( $more_text ) . '';
51 | if ( ! empty( $schema_data['use_button_style'] ) ) {
52 | $url = '
';
53 | } else {
54 | $url = '
' . $link . '
';
55 | }
56 | }
57 | continue;
58 | }
59 |
60 | $reviewed_item_data .= '
' . $data['label'] . ': ' . $schema_data[ $data['name'] ] . '
';
61 | }
62 | if ( ! empty( $image ) ) {
63 | echo '
' . $image . '
';
64 | }
65 | if ( ! empty( $reviewed_item_data ) ) {
66 | echo '
' . $reviewed_item_data . $url . '
';
67 | }
68 | ?>
69 |
70 |
--------------------------------------------------------------------------------
/comments/comments.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
21 |
22 |
23 |
67 |
68 |
69 |
70 |
94 |
95 |
--------------------------------------------------------------------------------
/includes/ajax.php:
--------------------------------------------------------------------------------
1 | 0 &&
56 | ! wp_review_has_reviewed( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) &&
57 | ( is_user_logged_in() || ! wp_review_option( 'registered_only' ) )
58 | ) {
59 | $insert = wp_insert_comment(
60 | array(
61 | 'user_id' => $user_id,
62 | 'comment_type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
63 | 'comment_post_ID' => $post_id,
64 | 'comment_parent' => 0,
65 | 'comment_author_IP' => $uip,
66 | // translators: review text.
67 | 'comment_content' => sprintf( __( 'Visitor Rating: %s', 'wp-review' ), $review_text ),
68 | 'comment_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
69 | 'comment_date' => current_time( 'mysql' ),
70 | 'comment_date_gmt' => current_time( 'mysql', 1 ),
71 | 'comment_approved' => 1,
72 | )
73 | );
74 |
75 | if ( $insert ) {
76 | if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review ) ) {
77 | $post_reviews = mts_get_post_reviews( $post_id, true );
78 |
79 | echo $post_reviews['rating'] . '|' . $post_reviews['count'];
80 | exit;
81 | } else {
82 | wp_delete_comment( $insert );
83 | }
84 | }
85 | }
86 |
87 | echo 'MTS_REVIEW_DB_ERROR';
88 | exit;
89 | }
90 |
91 |
92 | /**
93 | * AJAX User review rating
94 | * Replaces mts_review_get_review().
95 | */
96 | function wp_review_ajax_rate() {
97 | check_ajax_referer( 'wp-review-security', 'nonce' );
98 | $post_id = intval( $_POST['post_id'] );
99 | $review = filter_input( INPUT_POST, 'review' );
100 | $review = round( $review, 2 );
101 | $review_data = array(
102 | 'total' => $review,
103 | );
104 | wp_review_visitor_rate( $post_id, $review_data );
105 | exit;
106 | }
107 |
108 |
109 | /**
110 | * Migrates ratings.
111 | */
112 | function wp_review_ajax_migrate_ratings() {
113 | if ( ! current_user_can( 'manage_options' ) ) {
114 | return;
115 | }
116 |
117 | if ( get_option( 'wp_review_has_migrated', false ) ) {
118 | return;
119 | }
120 |
121 | global $wpdb;
122 |
123 | $start = isset( $_POST['start'] ) ? intval( $_POST['start'] ) : 0;
124 | $limit = 100;
125 | $current_blog_id = get_current_blog_id();
126 |
127 | $query = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->base_prefix . 'mts_wp_reviews WHERE blog_id = ' . $current_blog_id . ' LIMIT ' . $limit . ' OFFSET ' . $start ); // WPCS: unprepared SQL ok.
128 |
129 | foreach ( $query as $review ) {
130 |
131 | if ( 0 == $review->rate ) {
132 | continue; // Skip 0-star ratings.
133 | }
134 |
135 | $insert = wp_insert_comment(
136 | array(
137 | 'user_id' => $review->user_id,
138 | 'comment_type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
139 | 'comment_post_ID' => $review->post_id,
140 | 'comment_parent' => 0,
141 | 'comment_content' => sprintf(
142 | // translators: visitors rating.
143 | __( 'Visitor Rating: %s', 'wp-review' ),
144 | sprintf(
145 | // translators: review rate.
146 | __( '%s Stars', 'wp-review' ),
147 | $review->rate
148 | )
149 | ),
150 | 'comment_author_IP' => $review->user_ip,
151 | 'comment_date' => gmdate( 'Y-m-d H:i:s', ( strtotime( $review->date ) + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) ),
152 | 'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime( $review->date ) ),
153 | 'comment_approved' => 1,
154 | )
155 | );
156 |
157 | if ( $insert ) {
158 | if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review->rate ) ) {
159 | // Purge cache.
160 | mts_get_post_reviews( $review->post_id, true );
161 | } else {
162 | wp_delete_comment( $insert );
163 | }
164 | }
165 | }
166 |
167 | $end = $start + count( $query ); // $wpdb->num_rows;
168 | // $migrated_rows = get_option( 'wp_review_migrated_rows', 0 );
169 | update_option( 'wp_review_migrated_rows', $end );
170 |
171 | $total_rows = $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->base_prefix . 'mts_wp_reviews WHERE blog_id = ' . $current_blog_id ); // WPCS: unprepared SQL ok.
172 | $migration_finished = 0;
173 | if ( $total_rows == $end ) {
174 | update_option( 'wp_review_has_migrated', 1 );
175 | $migration_finished = 1;
176 | }
177 |
178 | echo wp_json_encode(
179 | array(
180 | 'start' => $start,
181 | 'lastrow' => $end,
182 | 'rowsleft' => $total_rows - $end,
183 | 'finished' => $migration_finished,
184 | )
185 | );
186 |
187 | die();
188 | }
189 |
190 |
191 | /**
192 | * Ajax handle for loading reviews.
193 | */
194 | function wp_review_ajax_load_reviews() {
195 | $options = $_POST; // WPCS: csrf ok.
196 |
197 | // Options are same as widgets args to keep compatibility.
198 | $options = wp_parse_args(
199 | $options,
200 | array(
201 | 'post_num' => 5,
202 | 'page' => 1,
203 | 'review_type' => '',
204 | 'thumb_size' => 'small',
205 | 'cat' => '',
206 | 'number_of_days' => '',
207 | )
208 | );
209 |
210 | $type = ! empty( $options['_type'] ) ? $options['_type'] : 'recent';
211 |
212 | $query = wp_review_get_reviews_query( $type, $options );
213 |
214 | if ( ! $query->have_posts() ) {
215 | wp_send_json_success( '' );
216 | }
217 |
218 | $page = ! empty( $options['page'] ) ? intval( $options['page'] ) : 1;
219 | $last_page = $query->max_num_pages;
220 | $in_widget = ! empty( $options['widget_id'] );
221 | $GLOBALS['in_widget'] = $in_widget;
222 |
223 | ob_start();
224 | echo '';
225 | while ( $query->have_posts() ) {
226 | $query->the_post();
227 | $classes = array( 'thumbnail' );
228 | $classes[] = 'thumb_' . $options['thumb_size'];
229 | if ( ! has_post_thumbnail() ) {
230 | $classes[] = 'wp-review-no-thumbnail';
231 | }
232 | $classes = implode( ' ', $classes );
233 | ?>
234 | -
235 |
236 |
237 |
238 |
239 |
240 |
; ?>)
241 |
242 |
243 |
244 |
245 |
246 |
247 |
254 |
255 |
256 | $in_widget,
260 | 'color' => '#fff',
261 | 'inactive_color' => '#dedcdc',
262 | );
263 | } else {
264 | $args = array();
265 | }
266 | wp_review_show_total( true, 'review-total-only ' . $options['thumb_size'] . '-thumb', null, $args );
267 | ?>
268 |
269 |
270 |
271 |
272 |
273 |
274 | ';
277 | wp_reset_postdata();
278 |
279 | if ( intval( $options['allow_pagination'] ) && -1 != $options['post_num'] ) {
280 | wp_review_ajax_pagination( $page, $last_page );
281 | }
282 | $output = ob_get_clean();
283 | unset( $GLOBALS['in_widget'] );
284 |
285 | wp_send_json_success( $output );
286 | }
287 |
288 |
289 | /**
290 | * Shows review extra information like post date, reviews count.
291 | *
292 | * @since 3.0.8
293 | *
294 | * @param int $post_id Post ID.
295 | * @param int $extra_info Extra info. 1 for date, 2 for reviews count, 0 for none.
296 | * @param array $args Custom args.
297 | */
298 | function wp_review_extra_info( $post_id, $extra_info, array $args = array() ) {
299 | if ( ! $extra_info ) {
300 | return;
301 | }
302 |
303 | $args = wp_parse_args(
304 | $args,
305 | array(
306 | 'class' => 'postmeta',
307 | 'date_format' => get_option( 'date_format' ),
308 | )
309 | );
310 |
311 | if ( 1 === $extra_info ) {
312 | ?>
313 |
314 |
315 |
316 |
322 |
323 |
332 |
333 | $total / $count,
366 | 'type' => $type,
367 | 'features' => $rating,
368 | );
369 | wp_review_visitor_rate( $post_id, $review_data );
370 | }
371 |
372 |
373 | /**
374 | * Ajax handler for purging ratings.
375 | *
376 | * @since 3.0.0
377 | */
378 | function wp_review_ajax_purge_ratings() {
379 | check_ajax_referer( 'wpr_purge_ratings', 'nonce' );
380 | $query_args = array();
381 | if ( ! empty( $_POST['type'] ) ) {
382 | $query_args['type'] = 'visitor' === $_POST['type'] ? WP_REVIEW_COMMENT_TYPE_VISITOR : WP_REVIEW_COMMENT_TYPE_COMMENT;
383 | } else {
384 | $query_args['type_in'] = array( WP_REVIEW_COMMENT_TYPE_VISITOR, WP_REVIEW_COMMENT_TYPE_COMMENT );
385 | }
386 | if ( ! empty( $_POST['postId'] ) ) {
387 | $query_args['post_id'] = intval( $_POST['postId'] );
388 | }
389 | $comments = get_comments( $query_args );
390 | if ( ! $comments ) {
391 | wp_send_json_success( esc_html__( 'Completed!', 'wp-review' ) );
392 | }
393 |
394 | $processed = array();
395 | foreach ( $comments as $comment ) {
396 | wp_delete_comment( $comment->comment_ID, false );
397 | if ( in_array( $comment->comment_post_ID, $processed ) ) {
398 | continue;
399 | }
400 | wp_review_clear_cached_reviews( $comment );
401 | $processed[] = $comment->comment_post_ID;
402 | }
403 | wp_send_json_success( esc_html__( 'Completed!', 'wp-review' ) );
404 | }
405 |
--------------------------------------------------------------------------------
/includes/enqueue.php:
--------------------------------------------------------------------------------
1 | admin_url( 'admin-ajax.php' ),
34 | 'loginRequiredMessage' => __( 'You must log in to add your review', 'wp-review' ),
35 | )
36 | );
37 |
38 | // Enqueue.
39 | wp_enqueue_script( 'js-cookie' );
40 | wp_enqueue_script( 'wp_review-js' );
41 | wp_enqueue_script( 'wp_review-jquery-appear' );
42 | wp_enqueue_style( 'wp_review-style' );
43 | }
44 |
45 | /**
46 | * IE7 style for the font icon.
47 | *
48 | * @since 1.0
49 | * @deprecated 3.0.0 Default icon font is no longer used.
50 | */
51 | function wp_review_ie7() {
52 | _deprecated_function( __FUNCTION__, '3.0.0' );
53 | ?>
54 |
57 | null,
29 | ),
30 | $atts,
31 | 'wp-review'
32 | );
33 |
34 | // Make sure jquery appear is enqueued.
35 | wp_enqueue_script( 'wp_review-jquery-appear' );
36 |
37 | $output = wp_review_get_data( $atts['id'] );
38 |
39 | return apply_filters( 'wp_review_shortcode', $output, $atts );
40 | }
41 |
42 |
43 | /**
44 | * Shortcode [wp-review-total] handler.
45 | *
46 | * @param array $atts Shortcode attributes.
47 | * @return string Shortcode output.
48 | */
49 | function wp_review_total_shortcode( $atts ) {
50 | $atts = shortcode_atts(
51 | array(
52 | 'id' => null,
53 | 'class' => 'review-total-only review-total-shortcode',
54 | 'context' => '',
55 | ),
56 | $atts,
57 | 'wp-review-total'
58 | );
59 |
60 | $args = array(
61 | 'shortcode' => true,
62 | );
63 |
64 | if ( 'product-rating' === $atts['context'] ) {
65 | $args = array(
66 | 'color' => '#fff',
67 | 'inactive_color' => '#dedcdc',
68 | 'context' => 'product-rating',
69 | );
70 | }
71 |
72 | $output = wp_review_show_total( false, $atts['class'], $atts['id'], $args );
73 |
74 | return apply_filters( 'wp_review_total_shortcode', $output, $atts );
75 | }
76 |
77 |
78 | /**
79 | * Shortcode [wp-review-visitor-rating] handler.
80 | *
81 | * @param array $atts Shortcode attributes.
82 | * @return string Shortcode output.
83 | */
84 | function wp_review_visitor_rating_shortcode( $atts ) {
85 | $atts = shortcode_atts(
86 | array(
87 | 'id' => get_the_ID(),
88 | ),
89 | $atts,
90 | 'wp-review-visitor-rating'
91 | );
92 |
93 | wp_enqueue_style( 'wp_review-style' );
94 | wp_enqueue_script( 'wp_review-jquery-appear' );
95 | wp_enqueue_script( 'wp_review-js' );
96 |
97 | ob_start();
98 | $post_reviews = mts_get_post_reviews( $atts['id'] );
99 | $value = $post_reviews['rating'];
100 | $count = $post_reviews['count'];
101 | ?>
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | ' . esc_html( $count ) . ''
115 | );
116 | ?>
117 |
118 |
119 |
120 |
121 |
122 |
123 |
2 |
3 |
--------------------------------------------------------------------------------
/public/fonts/font-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/fonts/font-icons.ttf
--------------------------------------------------------------------------------
/public/fonts/font-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/fonts/font-icons.woff
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/public/images/amazon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/amazon.jpg
--------------------------------------------------------------------------------
/public/images/aqua.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/aqua.jpg
--------------------------------------------------------------------------------
/public/images/blue.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/blue.jpg
--------------------------------------------------------------------------------
/public/images/darkside.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/darkside.jpg
--------------------------------------------------------------------------------
/public/images/dash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/dash.jpg
--------------------------------------------------------------------------------
/public/images/default.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/default.jpg
--------------------------------------------------------------------------------
/public/images/edge.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/edge.jpg
--------------------------------------------------------------------------------
/public/images/enterprise.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/enterprise.jpg
--------------------------------------------------------------------------------
/public/images/facebook.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/facebook.jpg
--------------------------------------------------------------------------------
/public/images/fizzy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/fizzy.jpg
--------------------------------------------------------------------------------
/public/images/gamer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/gamer.jpg
--------------------------------------------------------------------------------
/public/images/gravity.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/gravity.jpg
--------------------------------------------------------------------------------
/public/images/largethumb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/largethumb.png
--------------------------------------------------------------------------------
/public/images/shell.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/shell.jpg
--------------------------------------------------------------------------------
/public/images/smallthumb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/smallthumb.png
--------------------------------------------------------------------------------
/public/images/tabbed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/tabbed.jpg
--------------------------------------------------------------------------------
/public/images/tabbed2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/tabbed2.jpg
--------------------------------------------------------------------------------
/public/images/xiaomi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/xiaomi.jpg
--------------------------------------------------------------------------------
/public/images/zine.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyThemeShopTeam/WP-Review/112ae436f86bd04b05b905636830a2db502fc960/public/images/zine.jpg
--------------------------------------------------------------------------------
/public/js/js.cookie.min.js:
--------------------------------------------------------------------------------
1 | !function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e1){if(i=e({path:"/"},t.defaults,i),"number"==typeof i.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape);var f="";for(var s in i)i[s]&&(f+="; "+s,i[s]!==!0&&(f+="="+i[s]));return document.cookie=n+"="+r+f}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=0;d' + wpreview.loginRequiredMessage + '' );
36 | $this.append( $message );
37 | }
38 |
39 | $message.show();
40 |
41 | return false;
42 | });
43 | });
44 | })( jQuery );
45 |
46 | function wp_review_rate( $elem ) {// rating, postId, nonce ) {
47 | var rating = $elem.find('.wp-review-user-rating-val').val();
48 | var postId = $elem.find('.wp-review-user-rating-postid').val();
49 | var token = $elem.find('.wp-review-user-rating-nonce').val();
50 | var $target = $elem;
51 |
52 | if ( ! $target.is('.wp-review-user-rating') )
53 | $target = $elem.closest('.wp-review-user-rating');
54 |
55 | if ( rating == 0 ) {
56 | return '';
57 | }
58 |
59 | jQuery.ajax ({
60 | beforeSend: function() {
61 | $target.addClass('wp-review-loading');
62 | },
63 | data: { action: 'wp_review_rate', post_id: postId, nonce: token, review: rating },
64 | type: 'post',
65 | dataType: 'json',
66 | url: wpreview.ajaxurl,
67 | success: function( response ){
68 | $target.removeClass('wp-review-loading');
69 | if (typeof response.html !== 'undefined' && response.html != '') {
70 | $target.empty().append(response.html).addClass('has-rated').removeClass('wp-review-user-rating');
71 | }
72 |
73 | // update text total
74 | if (typeof response.rating_total !== 'undefined' && response.rating_total != '') {
75 | $target.parent().find('.wp-review-user-rating-total').text(response.rating_total);
76 | }
77 | // update rating count
78 | if (typeof response.rating_count !== 'undefined' && response.rating_count != '') {
79 | $target.parent().find('.wp-review-user-rating-counter').text(response.rating_count);
80 | }
81 | if ( response.awaiting_moderation != undefined ) {
82 | $target.parent().find('.user-total-wrapper .awaiting-response-wrapper').text(response.awaiting_moderation);
83 | }
84 |
85 | // Update cookie.
86 | Cookies.set( 'wpr_visitor_has_reviewed_post_' + postId, 1, {
87 | expires: 315360000000 // 10 years.
88 | });
89 | }
90 | });
91 | }
92 |
--------------------------------------------------------------------------------
/public/js/wp-review-tab-widget.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Plugin Name: WP Review
3 | * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4 | * Description: Create reviews! Choose from Stars, Percentages, Circles or Points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5 | * Author: MyThemesShop
6 | * Author URI: http://mythemeshop.com/
7 | */
8 | function wp_review_tab_loadTabContent( tab_name, page_num, container, args_obj ) {
9 |
10 | var container = jQuery( container );
11 | var tab_content = container.find( '#' + tab_name + '-tab-content' );
12 |
13 | // only load content if it wasn't already loaded
14 | var isLoaded = tab_content.data('loaded');
15 |
16 | if ( ! isLoaded || page_num != 1 ) {
17 | if ( ! container.hasClass( 'wp-review-tab-loading' ) ) {
18 | container.addClass( 'wp-review-tab-loading' );
19 |
20 | tab_content.load(wp_review_tab.ajax_url, {
21 | action: 'wp_review_tab_widget_content',
22 | tab: tab_name,
23 | page: page_num,
24 | args: args_obj
25 | }, function() {
26 | container.removeClass( 'wp-review-tab-loading' );
27 | tab_content.data( 'loaded', 1 ).hide().fadeIn().siblings().hide();
28 | }
29 | );
30 | }
31 | } else {
32 | tab_content.fadeIn().siblings().hide();
33 | }
34 | }
35 |
36 | jQuery(document).ready(function() {
37 | jQuery('.wp_review_tab_widget_content').each(function() {
38 | var $this = jQuery(this);
39 | var widget_id = this.id;
40 | var args = $this.data('args');
41 |
42 | // load tab content on click
43 | $this.find('.wp-review-tabs a').click(function(e) {
44 | e.preventDefault();
45 | jQuery(this).parent().addClass('selected').siblings().removeClass('selected');
46 | var tab_name = this.id.slice(0, -4); // -tab
47 | wp_review_tab_loadTabContent(tab_name, 1, $this, args);
48 | });
49 |
50 | // pagination
51 | $this.on('click', '.wp-review-tab-pagination a', function(e) {
52 | e.preventDefault();
53 | var $this_a = jQuery(this);
54 | var tab_name = $this_a.closest('.tab-content').attr('id').slice(0, -12); // -tab-content
55 | var page_num = parseInt($this_a.parents('.tab-content').find('.page_num').val());
56 |
57 | if ($this_a.hasClass('next')) {
58 | wp_review_tab_loadTabContent(tab_name, page_num + 1, $this, args);
59 | } else {
60 | $this.find('#'+tab_name+'-tab-content').data('loaded', 0);
61 | wp_review_tab_loadTabContent(tab_name, page_num - 1, $this, args);
62 | }
63 |
64 | });
65 |
66 | // load first tab now
67 | $this.find('.wp-review-tabs a').first().click();
68 | });
69 |
70 | });
71 |
--------------------------------------------------------------------------------
/rating-types/circle-input.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/rating-types/circle-output.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/rating-types/percentage-input.js:
--------------------------------------------------------------------------------
1 | ( function( $ ) {
2 | "use strict";
3 |
4 | $.fn.wprUserPercentageRating = function( options ) {
5 | var $wrapper, defaults;
6 | $wrapper = this;
7 | defaults = {
8 | rate: null
9 | };
10 | options = $.extend( {}, defaults, options );
11 |
12 | $wrapper.find('.review-result').each(function() {
13 | var $this = $(this);
14 | $this.closest('.review-result-wrapper').data('originalwidth', $this[0].style.width);
15 | });
16 |
17 | $wrapper.find('.review-result-wrapper').click(function(e) {
18 | var $this = $(this);
19 | var offset = $this.offset().left;
20 | var width = ( ( ( e.pageX - offset ) / $this.width() ) * 100 ).toFixed();
21 | if ( $('body').hasClass('rtl') ) {
22 | width = ( 100 - ( ( ( e.pageX - offset ) / $this.width() ) * 100 ) ).toFixed();
23 | }
24 |
25 |
26 | // snap to nearest 5
27 | // width = Math.round(width / 5) * 5;
28 |
29 | // no 0-star ratings allowed
30 | if ( width <= 0 ) {
31 | width = 1;
32 | }
33 | if ( width > 100 ) {
34 | width = 100;
35 | }
36 |
37 | $this.find('.review-result').width(width + '%');
38 | $this.data('originalrating', width );
39 | $this.data('originalwidth', $this.find('.review-result')[0].style.width);
40 |
41 | $wrapper.addClass('wp-review-input-set');
42 |
43 | // set input value
44 | $wrapper.find('.wp-review-user-rating-val').val( width );
45 |
46 | if ( typeof options.rate == 'function' ) {
47 | options.rate.call( $wrapper, parseFloat( width ) );
48 | }
49 | }).on('mouseenter mousemove', function(e) {
50 | var $this = $(this);
51 | var offset = $this.offset().left;
52 | var width = ( ( ( e.pageX - offset ) / $this.width() ) * 100 ).toFixed();
53 | if ( $('body').hasClass('rtl') ) {
54 | width = ( 100 - ( ( ( e.pageX - offset ) / $this.width() ) * 100 ) ).toFixed();
55 | }
56 |
57 | // snap to nearest 5
58 | // width = Math.round(width / 5) * 5;
59 |
60 | // no 0-star ratings allowed
61 | if ( width <= 0 ) {
62 | width = 1;
63 | }
64 | if ( width > 100 ) {
65 | width = 100;
66 | }
67 |
68 | $this.find('.review-result').width(width + '%');
69 |
70 | if ( $('body').hasClass('rtl') ) {
71 | $wrapper.find('.wp-review-your-rating').css('right', width + '%').find('.wp-review-your-rating-value').text(''+width+'%');
72 | } else {
73 | $wrapper.find('.wp-review-your-rating').css('left', width + '%').find('.wp-review-your-rating-value').text(''+width+'%');
74 | }
75 |
76 | }).on('mouseleave', function(e){
77 | var $this = $(this);
78 | $this.find('.review-result').width($this.data('originalwidth'));
79 | $wrapper.find('.wp-review-your-rating-value').text($this.data('originalrating')+'%');
80 | });
81 | };
82 |
83 | $( document ).ready( function() {
84 | $('.wp-review-user-rating-percentage, .wp-review-comment-rating-percentage').each( function() {
85 | $( this ).wprUserPercentageRating({
86 | rate: function( value ) {
87 | // console.log( this, value );
88 | wp_review_rate( this );
89 | }
90 | })
91 | });
92 | });
93 | })( jQuery );
94 |
--------------------------------------------------------------------------------
/rating-types/percentage-input.php:
--------------------------------------------------------------------------------
1 | ' . esc_html__( 'Add rating', 'wp-review' ) . '';
20 | return;
21 | }
22 |
23 | // For now, enqueue in footer.
24 | wp_enqueue_script( 'wp-review-percentage-input', trailingslashit( WP_REVIEW_URI ) . 'rating-types/percentage-input.js', array( 'jquery' ) );
25 |
26 | $class = 'wp-review-rating-input review-percentage';
27 | if ( ! empty( $rating['args']['class'] ) ) {
28 | $class .= ' ' . sanitize_html_class( $rating['args']['class'] );
29 | }
30 |
31 | $bg_color = '';
32 |
33 | if ( ! empty( $rating['colors']['inactive_color'] ) ) {
34 | $inactive_color = $rating['colors']['inactive_color'];
35 | $bg_color = "background-color: {$inactive_color};";
36 | }
37 | ?>
38 |
39 |
40 |
41 |
42 |
43 |
44 |
47 |
48 |
49 | ' ); // phpcs:ignore
52 | ?>
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/rating-types/percentage-output.php:
--------------------------------------------------------------------------------
1 |
30 |
36 |
--------------------------------------------------------------------------------
/rating-types/point-input.js:
--------------------------------------------------------------------------------
1 | ( function( $ ) {
2 | "use strict";
3 |
4 | $.fn.wprUserPointRating = function( options ) {
5 | var $wrapper, defaults;
6 | $wrapper = this;
7 | defaults = {
8 | rate: null
9 | };
10 | options = $.extend( {}, defaults, options );
11 |
12 | $wrapper.find('.review-result').each(function() {
13 | var $this = $(this);
14 | $this.closest('.review-result-wrapper').data('originalwidth', $this[0].style.width);
15 | });
16 |
17 | $wrapper.find('.review-result-wrapper').click(function(e) {
18 | var $this = $(this), value;
19 | var offset = $this.offset().left;
20 | var width = ( ( ( e.pageX - offset ) / $this.width() ) * 100 ).toFixed();
21 | if ( $('body').hasClass('rtl') ) {
22 | width = ( 100 - ( ( ( e.pageX - offset ) / $this.width() ) * 100 ) ).toFixed();
23 | if ( width > 100 ) {
24 | width = 100;
25 | }
26 | }
27 |
28 | // snap to nearest 5
29 | var width_snapped = Math.round(width / 5) * 5;
30 |
31 | // no 0-star ratings allowed
32 | if (width_snapped == 0)
33 | width_snapped = 5;
34 |
35 | value = width_snapped / 10;
36 | $this.find('.review-result').width(width_snapped + '%');
37 | $this.data('originalrating', ( value ) );
38 | $this.data('originalwidth', $this.find('.review-result')[0].style.width);
39 |
40 | $wrapper.addClass('wp-review-input-set');
41 |
42 | // set input value
43 | $wrapper.find('.wp-review-user-rating-val').val( value );
44 |
45 | if ( typeof options.rate == 'function' ) {
46 | options.rate.call( $wrapper, value );
47 | }
48 | // wp_review_rate( $wrapper );
49 | }).on('mouseenter mousemove', function(e) {
50 | var $this = $(this);
51 | var offset = $this.offset().left;
52 | var width = ( ( ( e.pageX - offset ) / $this.width() ) * 100 ).toFixed();
53 | if ( $('body').hasClass('rtl') ) {
54 | width = ( 100 - ( ( ( e.pageX - offset ) / $this.width() ) * 100 ) ).toFixed();
55 | if ( width > 100 ) {
56 | width = 100;
57 | }
58 | }
59 |
60 | // snap to nearest 0.5
61 | var width_snapped = Math.round(width / 5) * 5;
62 |
63 | // no 0-star ratings allowed
64 | if (width_snapped == 0)
65 | width_snapped = 5;
66 |
67 | $this.find('.review-result').width(width + '%');
68 |
69 | if ( $('body').hasClass('rtl') ) {
70 | $wrapper.find('.wp-review-your-rating').css('right', width + '%').find('.wp-review-your-rating-value').css('right', width_snapped + '%').text(''+(width_snapped/10)+'/10');
71 | } else {
72 | $wrapper.find('.wp-review-your-rating').css('left', width + '%').find('.wp-review-your-rating-value').css('left', width_snapped + '%').text(''+(width_snapped/10)+'/10');
73 | }
74 | }).on('mouseleave', function(e){
75 | var $this = $(this);
76 | var originalwidth = $this.data('originalwidth');
77 | $this.find('.review-result').width(originalwidth);
78 | if ( $('body').hasClass('rtl') ) {
79 | $wrapper.find('.wp-review-your-rating').css('right', originalwidth);
80 | } else {
81 | $wrapper.find('.wp-review-your-rating').css('left', originalwidth);
82 | }
83 | $wrapper.find('.wp-review-your-rating-value').text($this.data('originalrating')+'/10');
84 | });
85 | };
86 |
87 | $( document ).ready( function() {
88 | $('.wp-review-user-rating-point, .wp-review-comment-rating-point').each(function(index, el) {
89 | $( this ).wprUserPointRating({
90 | rate: function( value ) {
91 | // console.log( this, value );
92 | wp_review_rate( this );
93 | }
94 | })
95 | });
96 | });
97 | })( jQuery );
98 |
--------------------------------------------------------------------------------
/rating-types/point-input.php:
--------------------------------------------------------------------------------
1 | ' . esc_html__( 'Add rating', 'wp-review' ) . '';
20 | return;
21 | }
22 |
23 | // For now, enqueue in footer.
24 | wp_enqueue_script( 'wp-review-point-input', trailingslashit( WP_REVIEW_URI ) . 'rating-types/point-input.js', array( 'jquery' ) );
25 |
26 | $class = 'wp-review-rating-input review-point';
27 | if ( ! empty( $rating['args']['class'] ) ) {
28 | $class .= ' ' . sanitize_html_class( $rating['args']['class'] );
29 | }
30 |
31 | $bg_color = '';
32 | if ( ! empty( $rating['colors']['inactive_color'] ) ) {
33 | $inactive_color = $rating['colors']['inactive_color'];
34 | $bg_color = "background-color: {$inactive_color};";
35 | }
36 | ?>
37 |
38 |
39 |
40 |
41 |
42 |
43 |
46 |
47 |
48 | ' ); // phpcs:ignore
51 | ?>
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/rating-types/point-output.php:
--------------------------------------------------------------------------------
1 |
29 |
35 |
--------------------------------------------------------------------------------
/rating-types/star-input.js:
--------------------------------------------------------------------------------
1 | ( function( $, wpreview ) {
2 | "use strict";
3 |
4 | $.fn.wprUserStarRating = function( options ) {
5 | var $wrapper, defaults;
6 | $wrapper = this;
7 | defaults = {
8 | rate: null
9 | };
10 | options = $.extend( {}, defaults, options );
11 |
12 | $wrapper.find( '.review-result-wrapper > span' ).click( function( event ) {
13 | var stars = $( this ).data( 'input-value' );
14 | $wrapper.find( '.review-result').css( 'width', '' + ( 20 * stars ) + '%');
15 | $wrapper.find( '.wp-review-user-rating-val' ).val( stars );
16 | if ( typeof options.rate == 'function' ) {
17 | options.rate.call( $wrapper, stars );
18 | }
19 | });
20 | };
21 |
22 | $( document ).ready( function() {
23 | $( '.wp-review-user-rating-star, .wp-review-comment-rating-star' ).each( function() {
24 | $( this ).wprUserStarRating({
25 | rate: function( value ) {
26 | wp_review_rate( this );
27 | }
28 | })
29 | });
30 | });
31 | })( jQuery, wpreview );
32 |
--------------------------------------------------------------------------------
/rating-types/star-input.php:
--------------------------------------------------------------------------------
1 | ' . esc_html__( 'Add rating', 'wp-review' ) . '';
20 | return;
21 | }
22 |
23 | // For now, enqueue in footer.
24 | wp_enqueue_script( 'wp-review-star-input', trailingslashit( WP_REVIEW_URI ) . 'rating-types/star-input.js', array( 'jquery' ) );
25 |
26 | // $feature_selector = empty( $rating['feature_id'] ) ? '' : "[data-feature-id=\"{$rating['feature_id']}\"]";
27 | $class = 'wp-review-rating-input review-star';
28 | if ( ! empty( $rating['args']['class'] ) ) {
29 | $class .= sanitize_html_class( $rating['args']['class'] );
30 | }
31 |
32 | $rating_icon = wp_review_get_rating_icon();
33 | $rating_image = wp_review_get_rating_image();
34 | $id = 'wp-review-star-rating-' . mt_rand( 1000, 9999 );
35 | $wrapper_selector = '#' . $id;
36 | ?>
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |

',
49 | esc_attr( $i ),
50 | $rating_image
51 | ); // WPCS: xss ok.
52 | } else {
53 | printf(
54 | '
',
55 | esc_attr( $i ),
56 | esc_attr( $rating_icon )
57 | );
58 | }
59 | }
60 | ?>
61 |
62 | ';
66 | } else {
67 | echo '';
68 | }
69 | endfor;
70 | ?>
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
85 |
113 |
--------------------------------------------------------------------------------
/rating-types/star-output.php:
--------------------------------------------------------------------------------
1 |
28 |
29 |
>
30 |
34 |
; ?>)
35 |
38 |
39 |
43 |
44 |
45 |
49 |
; ?>)
50 |
53 |
54 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/rating-types/thumbs-input.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/rating-types/thumbs-output.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/template-list.php:
--------------------------------------------------------------------------------
1 | __( 'Default', 'wp-review' ),
18 | 'image' => WP_REVIEW_ASSETS . 'images/default.jpg',
19 | 'color' => '#1e73be',
20 | 'inactive_color' => '#95bae0',
21 | 'fontcolor' => '#555',
22 | 'bgcolor1' => '#e7e7e7',
23 | 'bgcolor2' => '#fff',
24 | 'bordercolor' => '#e7e7e7',
25 | 'width' => 100, // In percentage.
26 | 'align' => 'left',
27 | 'custom_comment_colors' => false,
28 | 'rating_icon' => 'fa fa-star',
29 | 'comment_color' => '#ffb300',
30 | 'comment_inactive_color' => '#ffb300',
31 | );
32 |
33 | $templates = apply_filters(
34 | 'wp_review_box_templates',
35 | array(
36 | 'amazon' => array(
37 | 'title' => __( 'Amazon', 'wp-review' ),
38 | 'image' => WP_REVIEW_ASSETS . 'images/amazon.jpg',
39 | 'color' => '#ffbe01',
40 | 'inactive_color' => '#f4f4f4',
41 | 'fontcolor' => '#111111',
42 | 'bgcolor1' => '#ffbe01',
43 | 'bgcolor2' => '#ffffff',
44 | 'bordercolor' => '#ffffff',
45 | ),
46 | 'aqua' => array(
47 | 'title' => __( 'Aqua', 'wp-review' ),
48 | 'image' => WP_REVIEW_ASSETS . 'images/aqua.jpg',
49 | 'color' => '#de5ea4',
50 | 'inactive_color' => '#f5d9e8',
51 | 'fontcolor' => '#4e565b',
52 | 'bgcolor1' => '#8e74ea',
53 | 'bgcolor2' => '#ffffff',
54 | 'bordercolor' => '#dfdaea',
55 | ),
56 | 'blue' => array(
57 | 'title' => __( 'Blue', 'wp-review' ),
58 | 'image' => WP_REVIEW_ASSETS . 'images/blue.jpg',
59 | 'color' => '#689FCE',
60 | 'inactive_color' => '#b1c6dc',
61 | 'fontcolor' => '#999999',
62 | 'bgcolor1' => '#f3f3f3',
63 | 'bgcolor2' => '#f3f3f3',
64 | 'bordercolor' => '#f3f3f3',
65 | ),
66 | 'darkside' => array(
67 | 'title' => __( 'Darkside', 'wp-review' ),
68 | 'image' => WP_REVIEW_ASSETS . 'images/darkside.jpg',
69 | 'color' => '#ed576c',
70 | 'fontcolor' => '#d0d0d0',
71 | 'bgcolor1' => '#20253b',
72 | 'bgcolor2' => '#20253b',
73 | 'bordercolor' => '#41465c',
74 | 'inactive_color' => '#41465c',
75 | 'comment_inactive_color' => '',
76 | ),
77 | 'dash' => array(
78 | 'title' => __( 'Dash', 'wp-review' ),
79 | 'image' => WP_REVIEW_ASSETS . 'images/dash.jpg',
80 | 'color' => '#378bcb',
81 | 'inactive_color' => '#8bbddb',
82 | 'fontcolor' => '#3f3f3f',
83 | 'bgcolor1' => '#378bcb',
84 | 'bgcolor2' => '#ffffff',
85 | 'bordercolor' => '#e8e8e8',
86 | ),
87 | 'edge' => array(
88 | 'title' => __( 'Edge', 'wp-review' ),
89 | 'image' => WP_REVIEW_ASSETS . 'images/edge.jpg',
90 | 'color' => '#f1c274',
91 | 'inactive_color' => '#f1e3cd',
92 | 'fontcolor' => '#6a788a',
93 | 'bgcolor1' => '#e77e34',
94 | 'bgcolor2' => '#ffffff',
95 | 'bordercolor' => '#edf2f9',
96 | ),
97 | 'enterprise' => array(
98 | 'title' => __( 'Enterprise', 'wp-review' ),
99 | 'image' => WP_REVIEW_ASSETS . 'images/enterprise.jpg',
100 | 'color' => '#f8937e',
101 | 'fontcolor' => '#666666',
102 | 'bgcolor1' => '#f8937e',
103 | 'bgcolor2' => '#f7e4c5',
104 | 'bordercolor' => '#ead7bb',
105 | 'inactive_color' => '#efbfa7',
106 | ),
107 | 'facebook' => array(
108 | 'title' => __( 'Facebook', 'wp-review' ),
109 | 'image' => WP_REVIEW_ASSETS . 'images/facebook.jpg',
110 | 'color' => '#4267b2',
111 | 'fontcolor' => '#333333',
112 | 'bgcolor1' => '#4267b2',
113 | 'bgcolor2' => '#ffffff',
114 | 'bordercolor' => '#e9eaed',
115 | 'inactive_color' => '#b7ceff',
116 | ),
117 | 'fizzy' => array(
118 | 'title' => __( 'Fizzy', 'wp-review' ),
119 | 'image' => WP_REVIEW_ASSETS . 'images/fizzy.jpg',
120 | 'color' => '#71CD7B',
121 | 'inactive_color' => '#cde6cf',
122 | 'fontcolor' => '#658694',
123 | 'bgcolor1' => '#F5F8F8',
124 | 'bgcolor2' => '#ffffff',
125 | 'bordercolor' => '#c8dde6',
126 | ),
127 | 'gamer' => array(
128 | 'title' => __( 'Gamer', 'wp-review' ),
129 | 'image' => WP_REVIEW_ASSETS . 'images/gamer.jpg',
130 | 'color' => '#d04622',
131 | 'inactive_color' => '#e2d4d1',
132 | 'fontcolor' => '#262626',
133 | 'bgcolor1' => '#2c2d31',
134 | 'bgcolor2' => '#f2f2f3',
135 | 'bordercolor' => '#cececf',
136 | ),
137 | 'gravity' => array(
138 | 'title' => __( 'Gravity', 'wp-review' ),
139 | 'image' => WP_REVIEW_ASSETS . 'images/gravity.jpg',
140 | 'color' => '#f2b852',
141 | 'fontcolor' => '#243a23',
142 | 'bgcolor1' => '#243a24',
143 | 'bgcolor2' => '#f1f0ec',
144 | 'bordercolor' => '#e3e2df',
145 | 'inactive_color' => '#f9e097',
146 | 'comment_inactive_color' => '',
147 | ),
148 | 'shell' => array(
149 | 'title' => __( 'Shell', 'wp-review' ),
150 | 'image' => WP_REVIEW_ASSETS . 'images/shell.jpg',
151 | 'color' => '#ec7d77',
152 | 'inactive_color' => '#d1eaef',
153 | 'fontcolor' => '#459cad',
154 | 'bgcolor1' => '#ffffff',
155 | 'bgcolor2' => '#f2f8f9',
156 | 'bordercolor' => '#d1eaef',
157 | ),
158 | 'tabbed-layout' => array(
159 | 'title' => __( 'Tabbed layout', 'wp-review' ),
160 | 'image' => WP_REVIEW_ASSETS . 'images/tabbed.jpg',
161 | 'color' => '#1e73be',
162 | 'inactive_color' => '#95bae0',
163 | 'fontcolor' => '#555',
164 | 'bgcolor1' => '#e7e7e7',
165 | 'bgcolor2' => '#fff',
166 | 'bordercolor' => '#e7e7e7',
167 | ),
168 | 'tabbed-layout2' => array(
169 | 'title' => __( 'Tabbed layout 2', 'wp-review' ),
170 | 'image' => WP_REVIEW_ASSETS . 'images/tabbed2.jpg',
171 | 'color' => '#98ba3b',
172 | 'inactive_color' => '#eff1e9',
173 | 'fontcolor' => '#413a43',
174 | 'bgcolor1' => '#615a63',
175 | 'bgcolor2' => '#ffffff',
176 | 'bordercolor' => '#f1edf1',
177 | ),
178 | 'xiaomi' => array(
179 | 'title' => __( 'Xiaomi', 'wp-review' ),
180 | 'image' => WP_REVIEW_ASSETS . 'images/xiaomi.jpg',
181 | 'color' => '#795548',
182 | 'inactive_color' => '#bcaaa4',
183 | 'fontcolor' => '#474747',
184 | 'bgcolor1' => '#efebe9',
185 | 'bgcolor2' => '#efebe9',
186 | 'bordercolor' => '#efebe9',
187 | ),
188 | 'zine' => array(
189 | 'title' => __( 'Zine', 'wp-review' ),
190 | 'image' => WP_REVIEW_ASSETS . 'images/zine.jpg',
191 | 'color' => '#04A9F5',
192 | 'inactive_color' => '#B3E5FC',
193 | 'fontcolor' => '#6a6a6a',
194 | 'bgcolor1' => '#f3fafb',
195 | 'bgcolor2' => '#f3fafb',
196 | 'bordercolor' => '#ffffff',
197 | ),
198 | )
199 | );
200 |
201 | foreach ( $templates as $index => $template ) {
202 | $templates[ $index ] = wp_parse_args( $template, $default );
203 | }
204 |
205 | return array( 'default' => $default ) + $templates;
206 | }
207 |
--------------------------------------------------------------------------------
/wp-review.php:
--------------------------------------------------------------------------------
1 | WP Review requires PHP version 5.6 or above. You are running version %s. Please update PHP to run this plugin.', 'wp-review' ), phpversion() );
39 | printf( '', $message ); // WPCS: XSS OK.
40 |
41 | deactivate_plugins( plugin_basename( __FILE__ ) );
42 | }
43 | add_action( 'admin_notices', 'wp_review_php_upgrade_notice' );
44 |
45 | return;
46 | }
47 |
48 | /* Plugin version */
49 | define( 'WP_REVIEW_PLUGIN_VERSION', '5.3.5' );
50 |
51 | /* Sets the custom db table name. */
52 | define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );
53 |
54 | /* When plugin is activated */
55 | register_activation_hook( __FILE__, 'wp_review_activation' );
56 |
57 | /* Defines constants used by the plugin. */
58 | add_action( 'plugins_loaded', 'wp_review_constants', 1 );
59 |
60 | /* Internationalize the text strings used. */
61 | add_action( 'plugins_loaded', 'wp_review_i18n', 2 );
62 |
63 | /* Loads libraries. */
64 | add_action( 'plugins_loaded', 'wp_review_includes_libraries', 3 );
65 |
66 | if ( ! function_exists( 'wp_review_constants' ) ) :
67 | /**
68 | * Defines constants.
69 | *
70 | * @since 1.0
71 | */
72 | function wp_review_constants() {
73 |
74 | /* Sets the path to the plugin directory. */
75 | define( 'WP_REVIEW_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
76 |
77 | /* Sets the path to the plugin directory URI. */
78 | define( 'WP_REVIEW_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );
79 |
80 | /* Sets the path to the `admin` directory. */
81 | define( 'WP_REVIEW_ADMIN', WP_REVIEW_DIR . trailingslashit( 'admin' ) );
82 |
83 | /* Sets the path to the `includes` directory. */
84 | define( 'WP_REVIEW_INCLUDES', WP_REVIEW_DIR . trailingslashit( 'includes' ) );
85 |
86 | /* Sets the path to the `assets` directory. */
87 | define( 'WP_REVIEW_ASSETS', WP_REVIEW_URI . 'public/' );
88 |
89 | /* Sets plugin base 'directory/file.php' */
90 | define( 'WP_REVIEW_PLUGIN_BASE', plugin_basename( __FILE__ ) );
91 |
92 | define( 'WP_REVIEW_COMMENT_TYPE_COMMENT', 'wp_review_comment' );
93 | define( 'WP_REVIEW_COMMENT_TYPE_VISITOR', 'wp_review_visitor' );
94 |
95 | define( 'WP_REVIEW_VISITOR_RATING_METAKEY', 'wp_review_visitor_rating' );
96 | define( 'WP_REVIEW_COMMENT_RATING_METAKEY', 'wp_review_comment_rating' );
97 | define( 'WP_REVIEW_COMMENT_TITLE_METAKEY', 'wp_review_comment_title' );
98 |
99 | define( 'WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY', 'wp_review_features_rating' );
100 |
101 | /* Keys for user review permissions */
102 | define( 'WP_REVIEW_REVIEW_DISABLED', 0 );
103 | define( 'WP_REVIEW_REVIEW_VISITOR_ONLY', 2 );
104 | define( 'WP_REVIEW_REVIEW_COMMENT_ONLY', 3 );
105 | define( 'WP_REVIEW_REVIEW_ALLOW_BOTH', 4 );
106 |
107 | define( 'WP_REVIEW_GRAPH_API_VERSION', '2.12' );
108 | }
109 | endif;
110 |
111 | if ( ! function_exists( 'wp_review_i18n' ) ) :
112 | /**
113 | * Internationalize the text strings used.
114 | *
115 | * @since 1.0
116 | */
117 | function wp_review_i18n() {
118 | load_plugin_textdomain( 'wp-review', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
119 | }
120 | endif;
121 |
122 | if ( ! function_exists( 'wp_review_includes_libraries' ) ) :
123 | /**
124 | * Loads the initial files needed by the plugin.
125 | *
126 | * @since 1.0
127 | */
128 | function wp_review_includes_libraries() {
129 |
130 | /* Loads the admin functions. */
131 | require_once( WP_REVIEW_ADMIN . 'admin.php' );
132 |
133 | /* Loads the meta boxes. */
134 | require_once( WP_REVIEW_ADMIN . 'metaboxes.php' );
135 |
136 | /* Loads the templates list. */
137 | require_once( WP_REVIEW_DIR . 'template-list.php' );
138 |
139 | /* Loads the front-end functions. */
140 | require_once( WP_REVIEW_INCLUDES . 'functions.php' );
141 |
142 | /* Loads ajax handles. */
143 | require_once( WP_REVIEW_INCLUDES . 'ajax.php' );
144 |
145 | /* Loads the widget. */
146 | require_once( WP_REVIEW_INCLUDES . 'widget.php' );
147 |
148 | /* Loads rate with comment functions. */
149 | require_once( WP_REVIEW_INCLUDES . 'comments.php' );
150 |
151 | /* Loads the enqueue functions. */
152 | require_once( WP_REVIEW_INCLUDES . 'enqueue.php' );
153 |
154 | /* Loads shortcodes */
155 | require_once( WP_REVIEW_INCLUDES . 'shortcodes.php' );
156 |
157 | /* Loads the settings page. */
158 | require_once( WP_REVIEW_ADMIN . 'class-wp-review-options.php' );
159 |
160 | /* Loads the form field class. */
161 | require_once( WP_REVIEW_ADMIN . 'class-wp-review-form-field.php' );
162 |
163 | /* Loads the importer. */
164 | require_once( WP_REVIEW_ADMIN . 'class-wp-review-importer.php' );
165 |
166 | /* Loads the demo importer. */
167 | require_once( WP_REVIEW_ADMIN . 'demo-importer.php' );
168 |
169 | /* Loads the review notice. */
170 | require_once( WP_REVIEW_ADMIN . 'class-wpr-review-notice.php' );
171 | }
172 | endif;
173 |
174 | if ( ! function_exists( 'wp_review_activation' ) ) :
175 | /**
176 | * Plugin activation.
177 | */
178 | function wp_review_activation() {
179 | require_once( plugin_dir_path( __FILE__ ) . '/admin/activation.php' );
180 | }
181 | endif;
182 |
--------------------------------------------------------------------------------
25 | 43 |
44 | 45 |46 | 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through. 48 | ?> 49 |
50 |
51 |
52 |
53 | 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through.
59 | ?>
60 |
61 |
62 |
63 |
64 |
65 |
66 |