WP Review - Version 3.0

Version Description

  • Major security updates
  • New AJAXified Tab widget for Popular and Recent reviews, try it, you gonna love it.
  • Language file updated fully.
  • Added a nonce (a security token) to ensure that the user actually voted from the review
  • More developer possibilities
  • Added filters for developers. Using a filter is much better than a function for setting the default colors.
  • Compatible with WordPress 3.9 Beta
  • Plugin will support the widget customizer coming up in WordPress 3.9
Download this release

Release Info

Developer MyThemeShop
Plugin Icon 128x128 WP Review
Version 3.0
Comparing to
See all releases

Code changes from version 2.0 to 3.0

admin/activation.php CHANGED
@@ -23,14 +23,4 @@ die(var_dump($e));*/
23
  }
24
  mts_create_review_tables();
25
 
26
- // set default colors
27
- $defaultColors = array(
28
- 'review_color' => '#1e73be',
29
- 'font_color' => '#555555',
30
- 'bg_color1' => '#e7e7e7',
31
- 'bg_color2' => '#ffffff',
32
- 'border_color' => '#e7e7e7'
33
- );
34
- wp_review_set_default_colors($defaultColors);
35
-
36
  ?>
23
  }
24
  mts_create_review_tables();
25
 
 
 
 
 
 
 
 
 
 
 
26
  ?>
admin/admin.php CHANGED
File without changes
admin/metaboxes.php CHANGED
@@ -86,16 +86,19 @@ function wp_review_render_meta_box_review_options( $post ) {
86
 
87
  /* Retrieve an existing value from the database. */
88
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
 
 
89
  ?>
90
 
91
  <p class="wp-review-field">
92
  <label for="wp_review_type"><?php _e( 'Review Type', 'wp-review' ); ?></label>
93
  <select name="wp_review_type" id="wp_review_type">
94
  <option value=""><?php _e( 'No Review', 'wp-review' ) ?></option>
95
- <option value="star" <?php selected( $type, 'star' ); ?>><?php _e( 'Star', 'wp-review' ) ?></option>
96
- <option value="point" <?php selected( $type, 'point' ); ?>><?php _e( 'Point', 'wp-review' ) ?></option>
97
- <option value="percentage" <?php selected( $type, 'percentage' ); ?>><?php _e( 'Percentage', 'wp-review' ) ?></option>
98
  </select>
 
99
  </p>
100
 
101
  <?php
@@ -107,9 +110,22 @@ function wp_review_render_meta_box_review_options( $post ) {
107
  * @since 1.0
108
  */
109
  function wp_review_render_meta_box_item( $post ) {
110
- global $post;
111
- $defaultColors = get_option('wp_review_default_colors');
112
-
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  /* Add an nonce field so we can check for it later. */
114
  wp_nonce_field( basename( __FILE__ ), 'wp-review-item-nonce' );
115
 
@@ -121,15 +137,26 @@ function wp_review_render_meta_box_item( $post ) {
121
  $bgcolor1 = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
122
  $bgcolor2 = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
123
  $bordercolor = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
124
- if( $color == '' ) $color = $defaultColors['review_color'];
125
- if( $fontcolor == '' ) $fontcolor = $defaultColors['font_color'];
126
- if( $bgcolor1 == '' ) $bgcolor1 = $defaultColors['bg_color1'];
127
- if( $bgcolor2 == '' ) $bgcolor2 = $defaultColors['bg_color2'];
128
- if( $bordercolor == '' ) $bordercolor = $defaultColors['border_color'];
129
-
 
 
 
 
 
 
 
 
 
 
 
130
  ?>
131
 
132
- <p class="wp-review-field">
133
  <label for="wp_review_location"><?php _e( 'Review Location', 'wp-review' ); ?></label>
134
  <select name="wp_review_location" id="wp_review_location">
135
  <option value="bottom" <?php selected( $location, 'bottom' ); ?>><?php _e( 'After Content', 'wp-review' ) ?></option>
@@ -144,27 +171,27 @@ function wp_review_render_meta_box_item( $post ) {
144
  <span><?php _e('Copy &amp; paste this shortcode in the content.', 'wp-review') ?></span>
145
  </p>
146
 
147
- <p class="wp-review-field">
148
  <label for="wp_review_color"><?php _e( 'Review Color', 'wp-review' ); ?></label>
149
  <input type="text" class="wp-review-color" name="wp_review_color" value="<?php echo $color; ?>" />
150
  </p>
151
 
152
- <p class="wp-review-field">
153
  <label for="wp_review_fontcolor"><?php _e( 'Font Color', 'wp-review' ); ?></label>
154
  <input type="text" class="wp-review-color" name="wp_review_fontcolor" id ="wp_review_fontcolor" value="<?php echo $fontcolor; ?>" />
155
  </p>
156
 
157
- <p class="wp-review-field">
158
  <label for="wp_review_bgcolor1"><?php _e( 'Heading Background Color', 'wp-review' ); ?></label>
159
  <input type="text" class="wp-review-color" name="wp_review_bgcolor1" id ="wp_review_bgcolor1" value="<?php echo $bgcolor1; ?>" />
160
  </p>
161
 
162
- <p class="wp-review-field">
163
  <label for="wp_review_bgcolor2"><?php _e( 'Background Color', 'wp-review' ); ?></label>
164
  <input type="text" class="wp-review-color" name="wp_review_bgcolor2" id="wp_review_bgcolor2" value="<?php echo $bgcolor2; ?>" />
165
  </p>
166
 
167
- <p class="wp-review-field">
168
  <label for="wp_review_bordercolor"><?php _e( 'Border Color', 'wp-review' ); ?></label>
169
  <input type="text" class="wp-review-color" name="wp_review_bordercolor" id="wp_review_bordercolor" value="<?php echo $bordercolor; ?>" />
170
  </p>
@@ -181,7 +208,7 @@ function wp_review_render_meta_box_item( $post ) {
181
  </thead>
182
 
183
  <tbody>
184
- <?php if ( $items ) : ?>
185
 
186
  <?php foreach ( $items as $item ) { ?>
187
 
@@ -190,7 +217,7 @@ function wp_review_render_meta_box_item( $post ) {
190
  <input type="text" class="widefat" name="wp_review_item_title[]" value="<?php if( !empty( $item['wp_review_item_title'] ) ) echo esc_attr( $item['wp_review_item_title'] ); ?>" />
191
  </td>
192
  <td>
193
- <input type="text" class="widefat review-star" name="wp_review_item_star[]" value="<?php if ( !empty ($item['wp_review_item_star'] ) ) echo $item['wp_review_item_star']; ?>" />
194
  </td>
195
  <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
196
  </tr>
@@ -201,7 +228,7 @@ function wp_review_render_meta_box_item( $post ) {
201
 
202
  <tr>
203
  <td><input type="text" class="widefat" name="wp_review_item_title[]" /></td>
204
- <td><input type="text" class="widefat review-star" name="wp_review_item_star[]" /></td>
205
  <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
206
  </tr>
207
 
@@ -210,7 +237,7 @@ function wp_review_render_meta_box_item( $post ) {
210
  <!-- empty hidden one for jQuery -->
211
  <tr class="empty-row screen-reader-text">
212
  <td><input type="text" class="widefat" name="wp_review_item_title[]" /></td>
213
- <td><input type="text" class="widefat" name="wp_review_item_star[]" /></td>
214
  <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
215
  </tr>
216
 
86
 
87
  /* Retrieve an existing value from the database. */
88
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
89
+
90
+ $available_types = apply_filters('wp_review_metabox_types', array('star' => __('Star', 'wp-review'), 'point' => __('Point', 'wp-review'), 'percentage' => __('Percentage', 'wp-review')));
91
  ?>
92
 
93
  <p class="wp-review-field">
94
  <label for="wp_review_type"><?php _e( 'Review Type', 'wp-review' ); ?></label>
95
  <select name="wp_review_type" id="wp_review_type">
96
  <option value=""><?php _e( 'No Review', 'wp-review' ) ?></option>
97
+ <?php foreach ($available_types as $available_type => $label) { ?>
98
+ <option value="<?php echo $available_type; ?>" <?php selected( $type, $available_type ); ?>><?php echo $label; ?></option>
99
+ <?php } ?>
100
  </select>
101
+ <span id="wp_review_id_hint">Review ID: <strong><?php echo $post->ID; ?></strong></span>
102
  </p>
103
 
104
  <?php
110
  * @since 1.0
111
  */
112
  function wp_review_render_meta_box_item( $post ) {
113
+ $defaultColors = apply_filters('wp_review_default_colors', array(
114
+ 'color' => '#1e73be',
115
+ 'fontcolor' => '#555555',
116
+ 'bgcolor1' => '#e7e7e7',
117
+ 'bgcolor2' => '#ffffff',
118
+ 'bordercolor' => '#e7e7e7'
119
+ ));
120
+ $defaultLocation = apply_filters('wp_review_default_location', 'bottom');
121
+
122
+ $defaultCriteria = apply_filters('wp_review_default_criteria', array());
123
+ $defaultItems = array();
124
+ foreach ($defaultCriteria as $item) {
125
+ $defaultItems[] = array( 'wp_review_item_title' => $item, 'wp_review_item_star' => '');
126
+ }
127
+
128
+
129
  /* Add an nonce field so we can check for it later. */
130
  wp_nonce_field( basename( __FILE__ ), 'wp-review-item-nonce' );
131
 
137
  $bgcolor1 = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
138
  $bgcolor2 = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
139
  $bordercolor = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
140
+ if ( $items == '' ) $items = $defaultItems;
141
+ if( $color == '' ) $color = $defaultColors['color'];
142
+ if( $location == '' ) $location = $defaultLocation;
143
+ if( $fontcolor == '' ) $fontcolor = $defaultColors['fontcolor'];
144
+ if( $bgcolor1 == '' ) $bgcolor1 = $defaultColors['bgcolor1'];
145
+ if( $bgcolor2 == '' ) $bgcolor2 = $defaultColors['bgcolor2'];
146
+ if( $bordercolor == '' ) $bordercolor = $defaultColors['bordercolor'];
147
+
148
+ $fields = array(
149
+ 'location' => true,
150
+ 'color' => true,
151
+ 'fontcolor' => true,
152
+ 'bgcolor1' => true,
153
+ 'bgcolor2' => true,
154
+ 'bordercolor' => true
155
+ );
156
+ $displayed_fields = apply_filters('wp_review_metabox_item_fields', $fields);
157
  ?>
158
 
159
+ <p class="wp-review-field"<?php if (empty($displayed_fields['location'])) echo ' style="display: none;"'; ?>>
160
  <label for="wp_review_location"><?php _e( 'Review Location', 'wp-review' ); ?></label>
161
  <select name="wp_review_location" id="wp_review_location">
162
  <option value="bottom" <?php selected( $location, 'bottom' ); ?>><?php _e( 'After Content', 'wp-review' ) ?></option>
171
  <span><?php _e('Copy &amp; paste this shortcode in the content.', 'wp-review') ?></span>
172
  </p>
173
 
174
+ <p class="wp-review-field"<?php if (empty($displayed_fields['color'])) echo ' style="display: none;"'; ?>>
175
  <label for="wp_review_color"><?php _e( 'Review Color', 'wp-review' ); ?></label>
176
  <input type="text" class="wp-review-color" name="wp_review_color" value="<?php echo $color; ?>" />
177
  </p>
178
 
179
+ <p class="wp-review-field"<?php if (empty($displayed_fields['fontcolor'])) echo ' style="display: none;"'; ?>>
180
  <label for="wp_review_fontcolor"><?php _e( 'Font Color', 'wp-review' ); ?></label>
181
  <input type="text" class="wp-review-color" name="wp_review_fontcolor" id ="wp_review_fontcolor" value="<?php echo $fontcolor; ?>" />
182
  </p>
183
 
184
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bgcolor1'])) echo ' style="display: none;"'; ?>>
185
  <label for="wp_review_bgcolor1"><?php _e( 'Heading Background Color', 'wp-review' ); ?></label>
186
  <input type="text" class="wp-review-color" name="wp_review_bgcolor1" id ="wp_review_bgcolor1" value="<?php echo $bgcolor1; ?>" />
187
  </p>
188
 
189
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bgcolor2'])) echo ' style="display: none;"'; ?>>
190
  <label for="wp_review_bgcolor2"><?php _e( 'Background Color', 'wp-review' ); ?></label>
191
  <input type="text" class="wp-review-color" name="wp_review_bgcolor2" id="wp_review_bgcolor2" value="<?php echo $bgcolor2; ?>" />
192
  </p>
193
 
194
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bordercolor'])) echo ' style="display: none;"'; ?>>
195
  <label for="wp_review_bordercolor"><?php _e( 'Border Color', 'wp-review' ); ?></label>
196
  <input type="text" class="wp-review-color" name="wp_review_bordercolor" id="wp_review_bordercolor" value="<?php echo $bordercolor; ?>" />
197
  </p>
208
  </thead>
209
 
210
  <tbody>
211
+ <?php if ( !empty($items) ) : ?>
212
 
213
  <?php foreach ( $items as $item ) { ?>
214
 
217
  <input type="text" class="widefat" name="wp_review_item_title[]" value="<?php if( !empty( $item['wp_review_item_title'] ) ) echo esc_attr( $item['wp_review_item_title'] ); ?>" />
218
  </td>
219
  <td>
220
+ <input type="text" min="1" step="1" autocomplete="off" class="widefat review-star" name="wp_review_item_star[]" value="<?php if ( !empty ($item['wp_review_item_star'] ) ) echo $item['wp_review_item_star']; ?>" />
221
  </td>
222
  <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
223
  </tr>
228
 
229
  <tr>
230
  <td><input type="text" class="widefat" name="wp_review_item_title[]" /></td>
231
+ <td><input type="text" min="1" step="1" autocomplete="off" class="widefat review-star" name="wp_review_item_star[]" /></td>
232
  <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
233
  </tr>
234
 
237
  <!-- empty hidden one for jQuery -->
238
  <tr class="empty-row screen-reader-text">
239
  <td><input type="text" class="widefat" name="wp_review_item_title[]" /></td>
240
+ <td><input type="text" min="1" step="1" autocomplete="off" class="widefat" name="wp_review_item_star[]" /></td>
241
  <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
242
  </tr>
243
 
assets/css/admin.css CHANGED
@@ -45,4 +45,7 @@
45
  }
46
  #wp_review_shortcode_hint {
47
  width: 94px;
 
 
 
48
  }
45
  }
46
  #wp_review_shortcode_hint {
47
  width: 94px;
48
+ }
49
+ #wp_review_id_hint {
50
+ margin-left: 8px;
51
  }
assets/css/wp-review-ie7.css CHANGED
File without changes
assets/css/wp-review-tab-widget.css ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wp_review_tab_widget_content {
2
+ position: relative;
3
+ border: 1px solid #E4E4E4;
4
+ }
5
+ .wp_review_tab_widget_content img {
6
+ max-width: 100%;
7
+ height: auto;
8
+ }
9
+ .wp_review_tab_widget_content a {
10
+ color: #444;
11
+ }
12
+ .wp_review_tab_widget_content ul.wp-review-tabs li {
13
+ list-style: none;
14
+ display: block;
15
+ width: 50%;
16
+ float: left;
17
+ text-align: center;
18
+ margin: 0;
19
+ padding: 0 !important;
20
+ }
21
+ .wp_review_tab_widget_content ul.has-1-tabs li {
22
+ width: 100%;
23
+ float: none;
24
+ margin: 0 auto;
25
+ }
26
+ .wp_review_tab_widget_content ul.has-2-tabs li {
27
+
28
+ }
29
+ .wp_review_tab_widget_content ul.has-3-tabs li {
30
+ width: 33.33%;
31
+ }
32
+ .wp_review_tab_widget_content ul.has-4-tabs li {
33
+ width: 50%;
34
+ }
35
+ .wp_review_tab_widget_content .tab_title a {
36
+ display: block;
37
+ background: #f0f0f0;
38
+ border-left: 1px solid #E4E4E4;
39
+ border-bottom: 1px solid #E4E4E4;
40
+ padding: 2px 0 4px;
41
+ line-height: 2.4;
42
+ text-decoration: none;
43
+ position: relative;
44
+ font-weight: bold;
45
+ }
46
+ .wp_review_tab_widget_content .tab_title:first-child a {
47
+ margin-left: 0;
48
+ border-left: 0;
49
+ }
50
+ .wp_review_tab_widget_content .tab_title.selected a {
51
+ background: #fff;
52
+ border-bottom: 1px solid #fff;
53
+ }
54
+
55
+
56
+ .wp_review_tab_widget_content .inside {
57
+ background: #fff;
58
+ padding-top: 10px;
59
+ }
60
+ .wp_review_tab_widget_content .tab-content li {
61
+ list-style-type: none;
62
+ float: left;
63
+ width: 100%;
64
+ -moz-box-sizing: border-box;
65
+ box-sizing: border-box;
66
+ margin: 0 0 15px 0;
67
+ padding: 0px 15px 10px 15px;
68
+ border-bottom: 1px solid #E4E4E4;
69
+ text-align: left;
70
+ color: #444;
71
+ background: none;
72
+ position: relative;
73
+ }
74
+ .wp_review_tab_widget_content .tab-content li:last-child {
75
+ border: none;
76
+ margin-bottom: 0;
77
+ }
78
+ .wp_review_tab_widget_content .tab-content li:first-child {
79
+ padding-top: 5px;
80
+ }
81
+
82
+ .wp_review_tab_thumb_small {
83
+ float: left;
84
+ margin-right: 12px;
85
+ padding-top: 4px;
86
+ width: 65px;
87
+ height: 65px;
88
+ overflow: hidden;
89
+ }
90
+ .wp_review_tab_thumb_large {
91
+ float: none;
92
+ max-width: 100%;
93
+ display: inline-block;
94
+ margin-bottom: 4px;
95
+ position: relative;
96
+ }
97
+ .wp_review_tab_widget_content .entry-title {
98
+ font-weight: bold;
99
+ margin: 0;
100
+ padding: 0;
101
+ }
102
+ .wp_review_tab_widget_content .wp-review-tab-postmeta {
103
+ color: #999;
104
+ font-size: 13px;
105
+ float: right;
106
+ margin-top: 5px;
107
+ }
108
+ .wp_review_tab_widget_content .wp-post-image {
109
+ margin: 0 !important;
110
+ }
111
+
112
+
113
+
114
+ /* Pagination */
115
+ .wp_review_tab_widget_content .wp-review-tab-pagination {
116
+ margin: 0;
117
+ width: 100%;
118
+ padding-top: 0;
119
+ padding-bottom: 15px;
120
+ float: left;
121
+ }
122
+ .wp_review_tab_widget_content .wp-review-tab-pagination a {
123
+ margin: 0 15px;
124
+ }
125
+ .wp-review-tab-pagination a.next {
126
+ float: right;
127
+ }
128
+
129
+ /* Loading... */
130
+ .wp-review-tab-loading:after {
131
+ content: "";
132
+ display: block;
133
+ position: absolute;
134
+ top: 0;
135
+ right: 0;
136
+ bottom: 0;
137
+ left: 0;
138
+ background-color: rgba(255,255,255,0.8);
139
+ }
140
+ .clear {
141
+ clear: both;
142
+ }
143
+
144
+ /* Rating... */
145
+ .wp_review_tab_widget_content .review-total-only {
146
+
147
+ }
148
+ .review-total-only.small-thumb {
149
+ font-size: 15px;
150
+ font-weight: bold;
151
+ padding: 0 4px;
152
+ margin-top: 4px;
153
+ float: left;
154
+ }
155
+ .review-total-only.small-thumb.review-type-star {
156
+ background: none;
157
+ padding: 0;
158
+ }
159
+ .review-total-only.large-thumb {
160
+ position: absolute;
161
+ top: 0; right: 15px;
162
+ }
163
+ li:first-child .review-total-only.large-thumb {
164
+ top: 5px;
165
+ right: 15px;
166
+ display: block;
167
+ }
168
+ .review-total-only.small-thumb .review-result-wrapper i {
169
+ color: #444 !important;
170
+ }
171
+ .wp_review_tab_widget_content .has-4-tabs .tab_title.selected a {
172
+ border-bottom: 1px solid #E4E4E4;
173
+ }
174
+ .wp_review_tab_widget_content .has-4-tabs .tab_title:nth-child(3) a {
175
+ border-left: 0;
176
+ }
177
+ .title-right {
178
+ overflow: hidden;
179
+ }
assets/css/wp-review.css CHANGED
@@ -1,417 +1,419 @@
1
- /*
2
- Plugin: WP Review
3
- Created By: MyThemeShop.com
4
- */
5
- .review-wrapper {
6
- border: 1px solid #e7e7e7;
7
- margin-bottom: 1.5em;
8
- overflow: hidden;
9
- }
10
-
11
- .review-title {
12
- background-color: #f6f6f6;
13
- border-bottom: 1px solid #e7e7e7;
14
- margin: 0;
15
- padding: 10px;
16
- }
17
-
18
- .review-wrapper .review-list {
19
- margin: 0;
20
- list-style: none;
21
- padding: 0;
22
- }
23
-
24
- .review-list li {
25
- border-bottom: 1px solid #e7e7e7;
26
- padding: 10px;
27
- position: relative;
28
- list-style: none;
29
- }
30
-
31
- .review-list li:nth-child(even) {
32
- background-color: #fafafa;
33
- }
34
-
35
- .review-list li:last-child {
36
- border-bottom: 1px solid #e7e7e7;
37
- }
38
-
39
- .review-summary-title {
40
- margin-bottom: 5px;
41
- }
42
-
43
- .review-desc {
44
- float: left;
45
- width: 75%;
46
- padding: 2%;
47
- -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
48
- }
49
-
50
- .review-desc p:last-child {
51
- margin-bottom: 0;
52
- }
53
-
54
- .review-result-wrapper i {
55
- font-style: normal;
56
- font-size: 16px;
57
- }
58
-
59
- .review-result {
60
- position: absolute;
61
- top: 0;
62
- left: 0;
63
- height: 22px;
64
- overflow: hidden;
65
- white-space: nowrap;
66
- }
67
-
68
- .review-total-wrapper {
69
- float: right;
70
- margin: 0;
71
- margin-right: 0;
72
- padding-right: 0;
73
- position: relative;
74
- -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
75
- margin-right: 20px;
76
- }
77
-
78
- .review-total-wrapper span.review-total-box {
79
- border-top: 0;
80
- border-bottom: 0;
81
- border-left: 0;
82
- border-right: 0;
83
- display: block;
84
- font-size: 40px;
85
- font-weight: 700;
86
- text-align: right;
87
- margin: 0;
88
- padding: 35px 0 20px;
89
- width: 100%;
90
- -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
91
- }
92
- .review-total-wrapper span.review-total-box small{font-size: 12px; display: block;}
93
- /*.review-total-wrapper span.review-total-box.hidden{display: none;}*/
94
- .percentage-icon {
95
- font-size: 22px;
96
- position: relative;
97
- top: -14px;
98
- }
99
-
100
- .review-total-star {
101
- position: relative;
102
- margin-top: 5px;
103
- margin: 5px auto 15px auto;
104
- float: right;
105
- }
106
-
107
- .review-total-star.allowed-to-rate{margin-top:-10px;}
108
-
109
- .review-total-star.allowed-to-rate.has-not-rated-yet a{cursor: pointer;}
110
-
111
- .review-total-star.allowed-to-rate.has-not-rated-yet:hover .review-result {opacity: 0; filter: alpha(opacity=0); display:none}
112
- .review-total-star.allowed-to-rate.has-not-rated-yet a:hover > i{opacity: 1; filter: alpha(opacity=1);}
113
- .review-total-star.allowed-to-rate a.hovered i{opacity: 1; filter: alpha(opacity=1);}
114
- .mts-review-wait-msg{display: none;}
115
-
116
- .review-total {
117
- position: absolute;
118
- top: 0px;
119
- left: 0px;
120
- height: 16px;
121
- z-index: 99;
122
- text-indent: -9999px;
123
- }
124
-
125
- .review-star {
126
- position: absolute;
127
- right: 20px;
128
- top: 10px;
129
- }
130
-
131
-
132
-
133
- /**
134
- * Bar & Percentage Point
135
- */
136
- .bar-point .review-star,
137
- .percentage-point .review-star {
138
- position: relative;
139
- margin: 6px 0;
140
- top: 0;
141
- right: 0;
142
- }
143
-
144
- .bar-point .review-result-wrapper,
145
- .percentage-point .review-result-wrapper {
146
- background: rgba(0,0,0,0.1) 0 -24px repeat-x;
147
- width: 100%;
148
- height: 22px;
149
- }
150
-
151
- .bar-point .review-result,
152
- .percentage-point .review-result {
153
- position: absolute;
154
- top: 0px;
155
- left: 0px;
156
- height: 22px;
157
- z-index: 99;
158
- text-indent: -9999px;
159
- }
160
-
161
- .review-total-star.allowed-to-rate .review-result-wrapper{background: none;}
162
- /**
163
- * Twenty series themes compatibilty
164
- */
165
- .entry-content .review-title,
166
- #content .review-title {
167
- margin: 0;
168
- }
169
-
170
- .entry-content .review-wrapper li {
171
- margin: 0;
172
- }
173
-
174
- .entry-content .review-summary-title,
175
- #content .review-summary-title {
176
- margin-bottom: 5px;
177
- }
178
-
179
- #content .review-list {
180
- margin: 0;
181
- }
182
-
183
- #content .review-desc p:last-child {
184
- margin-bottom: 0;
185
- }
186
-
187
- /**
188
- * Basic styling for wp_review_display_total
189
- */
190
- .review-total-only {
191
- padding: 3px 10px;
192
- background: rgba(0, 0, 0, 0.6);
193
- color:#fff;
194
- font-size:13px;
195
- display: inline-block;
196
- }
197
- .review-total-only .percentage-icon {
198
- font-size: inherit;
199
- top: 0;
200
- }
201
- .review-total-only .review-type-star {
202
- font-size:12px;
203
- padding: 3px 6px;
204
- }
205
- .review-total-only .review-total-star {
206
- font-size:12px;
207
- margin: 0;
208
- }
209
- .review-total-only .review-result-wrapper i {
210
- color: #FFF !important;
211
- opacity: 0.50;
212
- filter: alpha(opacity=50);
213
- }
214
- .review-total-only .review-result-wrapper .review-result i {
215
- opacity: 1;
216
- filter: alpha(opacity=100);
217
- }
218
-
219
- /**
220
- * Users review area
221
- */
222
- .user-review-area{ border-top: 1px solid #e7e7e7; /*border: none;*/ margin-top: -1.5em; overflow: hidden; padding: 10px; position: relative; clear: both;}
223
- .user-total-wrapper{float: left; margin:0; }
224
- .review-total-star.allowed-to-rate{float: right; margin:0;margin-right: 10px;}
225
- .user-total-wrapper .user-review-title{/*font-size: 20px;*/ font-weight: bold;margin:0;}
226
- .user-total-wrapper #mts-user-reviews-total{/*font-size: 20px;*/}
227
- /*.user-total-wrapper small{font-size:16px;}*/
228
- /*#review.review-wrapper{float: left; width: 45%;}*/
229
-
230
- /**
231
- * Font icon
232
- */
233
- @font-face {
234
- font-family: 'font-star';
235
- src: url('../fonts/font-star.eot?75880836');
236
- src: url('../fonts/font-star.eot?75880836#iefix') format('embedded-opentype'),
237
- url('../fonts/font-star.woff?75880836') format('woff'),
238
- url('../fonts/font-star.ttf?75880836') format('truetype'),
239
- url('../fonts/font-star.svg?75880836#font-star') format('svg');
240
- font-weight: normal;
241
- font-style: normal;
242
- }
243
-
244
- [class^="mts-icon-"]:before, [class*=" mts-icon-"]:before {
245
- font-family: "font-star";
246
- font-style: normal;
247
- font-weight: normal;
248
- speak: none;
249
- display: inline-block;
250
- text-decoration: inherit;
251
- width: 1em;
252
- margin-right: 0;
253
- text-align: center;
254
- font-variant: normal;
255
- text-transform: none;
256
- line-height: 1em;
257
- margin-left: 2px;
258
- }
259
-
260
- .mts-icon-star:before { content: '\e800'; }
261
-
262
- @font-face {
263
- font-family: 'font-loader';
264
- src: url('../fonts/font-loader.eot?75880836');
265
- src: url('../fonts/font-loader.eot?75880836#iefix') format('embedded-opentype'),
266
- url('../fonts/font-loader.woff?75880836') format('woff'),
267
- url('../fonts/font-loader.ttf?75880836') format('truetype'),
268
- url('../fonts/font-loader.svg?75880836#font-loader') format('svg');
269
- font-weight: normal;
270
- font-style: normal;
271
- }
272
-
273
- [class*="mts-icon-loader"]:before {
274
- font-family: "font-loader";
275
- font-style: normal;
276
- font-weight: normal;
277
- speak: none;
278
-
279
- display: inline-block;
280
- text-decoration: inherit;
281
- width: 1em;
282
- margin-right: .2em;
283
- text-align: center;
284
- /* opacity: .8; */
285
-
286
- /* For safety - reset parent styles, that can break glyph codes*/
287
- font-variant: normal;
288
- text-transform: none;
289
-
290
- /* fix buttons height, for twitter bootstrap */
291
- line-height: 1em;
292
-
293
- /* Animation center compensation - margins should be symmetric */
294
- /* remove if not needed */
295
- margin-left: .2em;
296
-
297
- /* you can be more comfortable with increased icons size */
298
- /* font-size: 120%; */
299
-
300
- /* Uncomment for 3D effect */
301
- /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
302
- }
303
-
304
-
305
-
306
-
307
- /*
308
- Spin Animation For Loader
309
- */
310
-
311
-
312
- .mts-icon-loader:before { content: '\e800'; } /* '' */
313
-
314
- .animate-spin {
315
- -moz-animation: spin 1s infinite linear;
316
- -o-animation: spin 1s infinite linear;
317
- -webkit-animation: spin 1s infinite linear;
318
- animation: spin 1s infinite linear;
319
- display: inline-block;
320
- }
321
- @-moz-keyframes spin {
322
- 0% {
323
- -moz-transform: rotate(0deg);
324
- -o-transform: rotate(0deg);
325
- -webkit-transform: rotate(0deg);
326
- transform: rotate(0deg);
327
- }
328
-
329
- 100% {
330
- -moz-transform: rotate(359deg);
331
- -o-transform: rotate(359deg);
332
- -webkit-transform: rotate(359deg);
333
- transform: rotate(359deg);
334
- }
335
- }
336
- @-webkit-keyframes spin {
337
- 0% {
338
- -moz-transform: rotate(0deg);
339
- -o-transform: rotate(0deg);
340
- -webkit-transform: rotate(0deg);
341
- transform: rotate(0deg);
342
- }
343
-
344
- 100% {
345
- -moz-transform: rotate(359deg);
346
- -o-transform: rotate(359deg);
347
- -webkit-transform: rotate(359deg);
348
- transform: rotate(359deg);
349
- }
350
- }
351
- @-o-keyframes spin {
352
- 0% {
353
- -moz-transform: rotate(0deg);
354
- -o-transform: rotate(0deg);
355
- -webkit-transform: rotate(0deg);
356
- transform: rotate(0deg);
357
- }
358
-
359
- 100% {
360
- -moz-transform: rotate(359deg);
361
- -o-transform: rotate(359deg);
362
- -webkit-transform: rotate(359deg);
363
- transform: rotate(359deg);
364
- }
365
- }
366
- @-ms-keyframes spin {
367
- 0% {
368
- -moz-transform: rotate(0deg);
369
- -o-transform: rotate(0deg);
370
- -webkit-transform: rotate(0deg);
371
- transform: rotate(0deg);
372
- }
373
-
374
- 100% {
375
- -moz-transform: rotate(359deg);
376
- -o-transform: rotate(359deg);
377
- -webkit-transform: rotate(359deg);
378
- transform: rotate(359deg);
379
- }
380
- }
381
- @keyframes spin {
382
- 0% {
383
- -moz-transform: rotate(0deg);
384
- -o-transform: rotate(0deg);
385
- -webkit-transform: rotate(0deg);
386
- transform: rotate(0deg);
387
- }
388
-
389
- 100% {
390
- -moz-transform: rotate(359deg);
391
- -o-transform: rotate(359deg);
392
- -webkit-transform: rotate(359deg);
393
- transform: rotate(359deg);
394
- }
395
- }
396
-
397
- /*-----------------------------------------------------*/
398
- /* Responsvie
399
- /*-----------------------------------------------------*/
400
- @media screen and (max-width:1040px) {
401
- .review-desc { width: 71%;}
402
- /*.review-total-wrapper { width: 26.8%; }*/
403
- }
404
-
405
- @media screen and (max-width:860px) {
406
- .review-desc { width: 66%;}
407
- /*.review-total-wrapper { width: 31.8%; }*/
408
- }
409
- @media screen and (max-width:470px) {
410
- .review-desc { padding: 4%; width: 100%;}
411
- .review-total-wrapper { width: 100%; margin-right: 0;}
412
- .review-total-wrapper span.review-total-box { padding: 10px 0 20px; text-align: left; padding-left: 10px;}
413
- .review-total-star { position: absolute; right: 20px; top: 5px;}
414
- .user-total-wrapper{width: 96%;}
415
- .review-total-star.allowed-to-rate{position: relative; right: auto;left: 0;float: left;}
416
-
 
 
417
  }
1
+ /*
2
+ Plugin: WP Review
3
+ Created By: MyThemeShop.com
4
+ */
5
+ .review-wrapper {
6
+ border: 1px solid #e7e7e7;
7
+ margin-bottom: 1.5em;
8
+ overflow: hidden;
9
+ clear: both;
10
+ }
11
+
12
+ .review-title {
13
+ background-color: #f6f6f6;
14
+ border-bottom: 1px solid #e7e7e7;
15
+ margin: 0;
16
+ padding: 10px;
17
+ }
18
+
19
+ .review-wrapper .review-list {
20
+ margin: 0;
21
+ list-style: none;
22
+ padding: 0;
23
+ }
24
+
25
+ .review-list li {
26
+ border-bottom: 1px solid #e7e7e7;
27
+ padding: 10px 15px;
28
+ position: relative;
29
+ list-style: none;
30
+ }
31
+
32
+ .review-list li:nth-child(even) {
33
+ background-color: #fafafa;
34
+ }
35
+
36
+ .review-list li:last-child {
37
+ border-bottom: 1px solid #e7e7e7;
38
+ }
39
+
40
+ .review-summary-title {
41
+ margin-bottom: 5px;
42
+ }
43
+
44
+ .review-desc {
45
+ float: left;
46
+ width: 75%;
47
+ padding: 10px 15px;
48
+ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
49
+ }
50
+
51
+ .review-desc p:last-child {
52
+ margin-bottom: 0;
53
+ }
54
+
55
+ .review-result-wrapper i {
56
+ font-style: normal;
57
+ font-size: 16px;
58
+ }
59
+
60
+ .review-result {
61
+ position: absolute;
62
+ top: 0;
63
+ left: 0;
64
+ height: 22px;
65
+ overflow: hidden;
66
+ white-space: nowrap;
67
+ }
68
+
69
+ .review-total-wrapper {
70
+ float: right;
71
+ margin: 0;
72
+ margin-right: 0;
73
+ padding-right: 0;
74
+ position: relative;
75
+ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
76
+ margin-right: 15px;
77
+ }
78
+
79
+ .review-total-wrapper span.review-total-box {
80
+ border-top: 0;
81
+ border-bottom: 0;
82
+ border-left: 0;
83
+ border-right: 0;
84
+ display: block;
85
+ font-size: 40px;
86
+ font-weight: 700;
87
+ text-align: right;
88
+ margin: 0;
89
+ padding: 35px 0 20px;
90
+ width: 100%;
91
+ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
92
+ }
93
+ .review-total-wrapper span.review-total-box small{font-size: 12px; display: block;}
94
+ /*.review-total-wrapper span.review-total-box.hidden{display: none;}*/
95
+ .percentage-icon {
96
+ font-size: 22px;
97
+ position: relative;
98
+ top: -14px;
99
+ }
100
+
101
+ .review-total-star {
102
+ position: relative;
103
+ margin-top: 5px;
104
+ margin: 5px auto 15px auto;
105
+ float: right;
106
+ }
107
+
108
+ .review-total-star.allowed-to-rate{margin-top:-10px;}
109
+
110
+ .review-total-star.allowed-to-rate.has-not-rated-yet a{cursor: pointer;}
111
+
112
+ .review-total-star.allowed-to-rate.has-not-rated-yet:hover .review-result {opacity: 0; filter: alpha(opacity=0); display:none}
113
+ .review-total-star.allowed-to-rate.has-not-rated-yet a:hover > i{opacity: 1; filter: alpha(opacity=1);}
114
+ .review-total-star.allowed-to-rate a.hovered i{opacity: 1; filter: alpha(opacity=1);}
115
+ .mts-review-wait-msg{display: none;}
116
+
117
+ .review-total {
118
+ position: absolute;
119
+ top: 0px;
120
+ left: 0px;
121
+ height: 16px;
122
+ z-index: 99;
123
+ text-indent: -9999px;
124
+ }
125
+
126
+ .review-star {
127
+ position: absolute;
128
+ right: 15px;
129
+ top: 10px;
130
+ }
131
+
132
+
133
+
134
+ /**
135
+ * Bar & Percentage Point
136
+ */
137
+ .bar-point .review-star,
138
+ .percentage-point .review-star {
139
+ position: relative;
140
+ margin: 6px 0;
141
+ top: 0;
142
+ right: 0;
143
+ }
144
+
145
+ .bar-point .review-result-wrapper,
146
+ .percentage-point .review-result-wrapper {
147
+ background: rgba(0,0,0,0.1) 0 -24px repeat-x;
148
+ width: 100%;
149
+ height: 22px;
150
+ }
151
+
152
+ .bar-point .review-result,
153
+ .percentage-point .review-result {
154
+ position: absolute;
155
+ top: 0px;
156
+ left: 0px;
157
+ height: 22px;
158
+ z-index: 99;
159
+ text-indent: -9999px;
160
+ }
161
+
162
+ .review-total-star.allowed-to-rate .review-result-wrapper{background: none;}
163
+ /**
164
+ * Twenty series themes compatibilty
165
+ */
166
+ .entry-content .review-title,
167
+ #content .review-title {
168
+ margin: 0;
169
+ }
170
+
171
+ .entry-content .review-wrapper li {
172
+ margin: 0;
173
+ }
174
+
175
+ .entry-content .review-summary-title,
176
+ #content .review-summary-title {
177
+ margin-bottom: 5px;
178
+ }
179
+
180
+ #content .review-list {
181
+ margin: 0;
182
+ }
183
+
184
+ #content .review-desc p:last-child {
185
+ margin-bottom: 0;
186
+ }
187
+
188
+ /**
189
+ * Basic styling for wp_review_display_total
190
+ */
191
+ .review-total-only {
192
+ padding: 3px 10px;
193
+ background: rgba(0, 0, 0, 0.6);
194
+ color:#fff;
195
+ font-size:13px;
196
+
197
+ display: inline-block;
198
+ }
199
+ .review-total-only .percentage-icon {
200
+ font-size: inherit;
201
+ top: 0;
202
+ }
203
+ .review-total-only .review-type-star {
204
+ font-size:12px;
205
+ padding: 3px 6px;
206
+ }
207
+ .review-total-only .review-total-star {
208
+ font-size:12px;
209
+ margin: 0;
210
+ }
211
+ .review-total-only .review-result-wrapper i {
212
+ color: #FFF !important;
213
+ opacity: 0.50;
214
+ filter: alpha(opacity=50);
215
+ }
216
+ .review-total-only .review-result-wrapper .review-result i {
217
+ opacity: 1;
218
+ filter: alpha(opacity=100);
219
+ }
220
+
221
+ /**
222
+ * Users review area
223
+ */
224
+ .user-review-area{ border-top: 1px solid #e7e7e7; margin-top: -1.5em; overflow: hidden; padding: 10px 15px; position: relative; clear: both;}
225
+ .user-total-wrapper{float: left; margin:0; }
226
+ .review-total-star.allowed-to-rate{float: right; margin:0;}
227
+ .user-total-wrapper .user-review-title{/*font-size: 20px;*/ font-weight: bold;margin:0;}
228
+ .user-total-wrapper #mts-user-reviews-total{/*font-size: 20px;*/}
229
+ /*.user-total-wrapper small{font-size:16px;}*/
230
+ /*#review.review-wrapper{float: left; width: 45%;}*/
231
+
232
+ /**
233
+ * Font icon
234
+ */
235
+ @font-face {
236
+ font-family: 'font-star';
237
+ src: url('../fonts/font-star.eot?75880836');
238
+ src: url('../fonts/font-star.eot?75880836#iefix') format('embedded-opentype'),
239
+ url('../fonts/font-star.woff?75880836') format('woff'),
240
+ url('../fonts/font-star.ttf?75880836') format('truetype'),
241
+ url('../fonts/font-star.svg?75880836#font-star') format('svg');
242
+ font-weight: normal;
243
+ font-style: normal;
244
+ }
245
+
246
+ [class^="mts-icon-"]:before, [class*=" mts-icon-"]:before {
247
+ font-family: "font-star";
248
+ font-style: normal;
249
+ font-weight: normal;
250
+ speak: none;
251
+ display: inline-block;
252
+ text-decoration: inherit;
253
+ width: 1em;
254
+ margin-right: 0;
255
+ text-align: center;
256
+ font-variant: normal;
257
+ text-transform: none;
258
+ line-height: 1em;
259
+ margin-left: 2px;
260
+ }
261
+
262
+ .mts-icon-star:before { content: '\e800'; }
263
+
264
+ @font-face {
265
+ font-family: 'font-loader';
266
+ src: url('../fonts/font-loader.eot?75880836');
267
+ src: url('../fonts/font-loader.eot?75880836#iefix') format('embedded-opentype'),
268
+ url('../fonts/font-loader.woff?75880836') format('woff'),
269
+ url('../fonts/font-loader.ttf?75880836') format('truetype'),
270
+ url('../fonts/font-loader.svg?75880836#font-loader') format('svg');
271
+ font-weight: normal;
272
+ font-style: normal;
273
+ }
274
+
275
+ [class*="mts-icon-loader"]:before {
276
+ font-family: "font-loader";
277
+ font-style: normal;
278
+ font-weight: normal;
279
+ speak: none;
280
+
281
+ display: inline-block;
282
+ text-decoration: inherit;
283
+ width: 1em;
284
+ margin-right: .2em;
285
+ text-align: center;
286
+ /* opacity: .8; */
287
+
288
+ /* For safety - reset parent styles, that can break glyph codes*/
289
+ font-variant: normal;
290
+ text-transform: none;
291
+
292
+ /* fix buttons height, for twitter bootstrap */
293
+ line-height: 1em;
294
+
295
+ /* Animation center compensation - margins should be symmetric */
296
+ /* remove if not needed */
297
+ margin-left: .2em;
298
+
299
+ /* you can be more comfortable with increased icons size */
300
+ /* font-size: 120%; */
301
+
302
+ /* Uncomment for 3D effect */
303
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
304
+ }
305
+
306
+
307
+
308
+
309
+ /*
310
+ Spin Animation For Loader
311
+ */
312
+
313
+
314
+ .mts-icon-loader:before { content: '\e800'; } /* '' */
315
+
316
+ .animate-spin {
317
+ -moz-animation: spin 1s infinite linear;
318
+ -o-animation: spin 1s infinite linear;
319
+ -webkit-animation: spin 1s infinite linear;
320
+ animation: spin 1s infinite linear;
321
+ display: inline-block;
322
+ }
323
+ @-moz-keyframes spin {
324
+ 0% {
325
+ -moz-transform: rotate(0deg);
326
+ -o-transform: rotate(0deg);
327
+ -webkit-transform: rotate(0deg);
328
+ transform: rotate(0deg);
329
+ }
330
+
331
+ 100% {
332
+ -moz-transform: rotate(359deg);
333
+ -o-transform: rotate(359deg);
334
+ -webkit-transform: rotate(359deg);
335
+ transform: rotate(359deg);
336
+ }
337
+ }
338
+ @-webkit-keyframes spin {
339
+ 0% {
340
+ -moz-transform: rotate(0deg);
341
+ -o-transform: rotate(0deg);
342
+ -webkit-transform: rotate(0deg);
343
+ transform: rotate(0deg);
344
+ }
345
+
346
+ 100% {
347
+ -moz-transform: rotate(359deg);
348
+ -o-transform: rotate(359deg);
349
+ -webkit-transform: rotate(359deg);
350
+ transform: rotate(359deg);
351
+ }
352
+ }
353
+ @-o-keyframes spin {
354
+ 0% {
355
+ -moz-transform: rotate(0deg);
356
+ -o-transform: rotate(0deg);
357
+ -webkit-transform: rotate(0deg);
358
+ transform: rotate(0deg);
359
+ }
360
+
361
+ 100% {
362
+ -moz-transform: rotate(359deg);
363
+ -o-transform: rotate(359deg);
364
+ -webkit-transform: rotate(359deg);
365
+ transform: rotate(359deg);
366
+ }
367
+ }
368
+ @-ms-keyframes spin {
369
+ 0% {
370
+ -moz-transform: rotate(0deg);
371
+ -o-transform: rotate(0deg);
372
+ -webkit-transform: rotate(0deg);
373
+ transform: rotate(0deg);
374
+ }
375
+
376
+ 100% {
377
+ -moz-transform: rotate(359deg);
378
+ -o-transform: rotate(359deg);
379
+ -webkit-transform: rotate(359deg);
380
+ transform: rotate(359deg);
381
+ }
382
+ }
383
+ @keyframes spin {
384
+ 0% {
385
+ -moz-transform: rotate(0deg);
386
+ -o-transform: rotate(0deg);
387
+ -webkit-transform: rotate(0deg);
388
+ transform: rotate(0deg);
389
+ }
390
+
391
+ 100% {
392
+ -moz-transform: rotate(359deg);
393
+ -o-transform: rotate(359deg);
394
+ -webkit-transform: rotate(359deg);
395
+ transform: rotate(359deg);
396
+ }
397
+ }
398
+
399
+ /*-----------------------------------------------------*/
400
+ /* Responsvie
401
+ /*-----------------------------------------------------*/
402
+ @media screen and (max-width:1040px) {
403
+ .review-desc { width: 71%;}
404
+ /*.review-total-wrapper { width: 26.8%; }*/
405
+ }
406
+
407
+ @media screen and (max-width:860px) {
408
+ .review-desc { width: 66%;}
409
+ /*.review-total-wrapper { width: 31.8%; }*/
410
+ }
411
+ @media screen and (max-width:470px) {
412
+ .review-desc { padding: 4%; width: 100%;}
413
+ .review-total-wrapper { width: 100%; margin-right: 0;}
414
+ .review-total-wrapper span.review-total-box { padding: 10px 0 20px; text-align: left; padding-left: 10px;}
415
+ .review-total-star { position: absolute; right: 20px; top: 5px;}
416
+ .user-total-wrapper{width: 96%;}
417
+ .review-total-star.allowed-to-rate{position: relative; right: auto;left: 0;float: left;}
418
+
419
  }
assets/fonts/font-loader.eot CHANGED
File without changes
assets/fonts/font-loader.svg CHANGED
File without changes
assets/fonts/font-loader.ttf CHANGED
File without changes
assets/fonts/font-loader.woff CHANGED
File without changes
assets/fonts/font-star.eot CHANGED
File without changes
assets/fonts/font-star.svg CHANGED
File without changes
assets/fonts/font-star.ttf CHANGED
File without changes
assets/fonts/font-star.woff CHANGED
File without changes
assets/images/bigthumb.png DELETED
Binary file
assets/images/largethumb.png ADDED
Binary file
assets/images/smallthumb.png CHANGED
Binary file
assets/js/admin.js CHANGED
@@ -27,6 +27,7 @@ $(document).ready(function() {
27
  $('#wp-review-metabox-desc').hide();
28
  $('#wp-review-metabox-userReview').hide();
29
  $('#wp_review_shortcode_hint_field').hide();
 
30
 
31
  $('#wp_review_type').on( 'change', function() {
32
 
@@ -34,6 +35,7 @@ $(document).ready(function() {
34
  $('#wp-review-metabox-heading').toggle( $(this).val() != '' );
35
  $('#wp-review-metabox-desc').toggle( $(this).val() != '' );
36
  $('#wp-review-metabox-userReview').toggle( $(this).val() != '' );
 
37
 
38
  if ( $(this).val() == 'point' ) {
39
  $('.dynamic-text').text('Points (1-10)');
@@ -74,6 +76,10 @@ $(document).ready(function() {
74
  $('#wp-review-metabox-userReview').show();
75
  }
76
 
 
 
 
 
77
  $('#wp_review_location').on('change', function() {
78
  $('#wp_review_shortcode_hint_field').toggle($(this).val() == 'custom');
79
  });
27
  $('#wp-review-metabox-desc').hide();
28
  $('#wp-review-metabox-userReview').hide();
29
  $('#wp_review_shortcode_hint_field').hide();
30
+ $('#wp_review_id_hint').hide();
31
 
32
  $('#wp_review_type').on( 'change', function() {
33
 
35
  $('#wp-review-metabox-heading').toggle( $(this).val() != '' );
36
  $('#wp-review-metabox-desc').toggle( $(this).val() != '' );
37
  $('#wp-review-metabox-userReview').toggle( $(this).val() != '' );
38
+ $('#wp_review_id_hint').toggle( $(this).val() != '' );
39
 
40
  if ( $(this).val() == 'point' ) {
41
  $('.dynamic-text').text('Points (1-10)');
76
  $('#wp-review-metabox-userReview').show();
77
  }
78
 
79
+ if ( $('#wp_review_type option:selected').val() != '' ) {
80
+ $('#wp_review_id_hint').show();
81
+ }
82
+
83
  $('#wp_review_location').on('change', function() {
84
  $('#wp_review_shortcode_hint_field').toggle($(this).val() == 'custom');
85
  });
assets/js/main.js CHANGED
@@ -12,12 +12,12 @@ jQuery(document).ready(function($){
12
  $('.review-total-star.allowed-to-rate .review-result-wrapper').hide();
13
  $('.mts-review-wait-msg').show();
14
  var blogID = $('#blog_id').val();
15
- var userIP = $('#mts-userIP').val();
16
  var post_id = $('#post_id').val();
17
  var user_id = $('#user_id').val();
18
  var review = $(this).attr('data-input-value');
19
  $.ajax ({
20
- data: {action: 'mts_review_get_review', post_id: post_id, user_id: user_id, ip: userIP, review: review},
21
  type: 'post',
22
  url: ajaxurl,
23
  success: function( response ){
12
  $('.review-total-star.allowed-to-rate .review-result-wrapper').hide();
13
  $('.mts-review-wait-msg').show();
14
  var blogID = $('#blog_id').val();
15
+ var token = $('#token').val();
16
  var post_id = $('#post_id').val();
17
  var user_id = $('#user_id').val();
18
  var review = $(this).attr('data-input-value');
19
  $.ajax ({
20
+ data: {action: 'mts_review_get_review', post_id: post_id, user_id: user_id, nonce: token, review: review},
21
  type: 'post',
22
  url: ajaxurl,
23
  success: function( response ){
assets/js/wp-review-tab-widget-admin.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).on('click', function(e) {
2
+ var $this = jQuery(e.target);
3
+ var $form = $this.closest('.wp_review_tab_options_form');
4
+
5
+ if ($this.is('.wp_review_tab_enable_toprated')) {
6
+ $form.find('.wp_review_tab_toprated_order').slideToggle($this.is(':checked'));
7
+ $form.find('.wp_review_tab_toprated_title').slideToggle($this.is(':checked'));
8
+ } else if ($this.is('.wp_review_tab_enable_recent')) {
9
+ $form.find('.wp_review_tab_recent_order').slideToggle($this.is(':checked'));
10
+ $form.find('.wp_review_tab_recent_title').slideToggle($this.is(':checked'));
11
+ } else if ($this.is('.wp_review_tab_enable_mostvoted')) {
12
+ $form.find('.wp_review_tab_mostvoted_order').slideToggle($this.is(':checked'));
13
+ $form.find('.wp_review_tab_mostvoted_title').slideToggle($this.is(':checked'));
14
+ } else if ($this.is('.wp_review_tab_enable_custom')) {
15
+ $form.find('.wp_review_tab_custom_order').slideToggle($this.is(':checked'));
16
+ $form.find('.wp_review_tab_custom_title').slideToggle($this.is(':checked'));
17
+ $form.find('.wp_review_tab_custom_reviews').slideToggle($this.is(':checked'));
18
+ } else if ($this.is('.wp_review_tab_order_header')) {
19
+ e.preventDefault();
20
+ $form.find('.wp_review_tab_order').slideToggle();
21
+ $form.find('.wp_review_tab_titles').slideUp();
22
+ } else if ($this.is('.wp_review_tab_titles_header')) {
23
+ e.preventDefault();
24
+ $form.find('.wp_review_tab_titles').slideToggle();
25
+ $form.find('.wp_review_tab_order').slideUp();
26
+ }
27
+ });
assets/js/wp-review-tab-widget.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function wp_review_tab_loadTabContent(tab_name, page_num, container, args_obj) {
2
+
3
+ var container = jQuery(container);
4
+ var tab_content = container.find('#'+tab_name+'-tab-content');
5
+
6
+ // only load content if it wasn't already loaded
7
+ var isLoaded = tab_content.data('loaded');
8
+
9
+ if (!isLoaded || page_num != 1) {
10
+ if (!container.hasClass('wp-review-tab-loading')) {
11
+ container.addClass('wp-review-tab-loading');
12
+
13
+ tab_content.load(wp_review_tab.ajax_url, {
14
+ action: 'wp_review_tab_widget_content',
15
+ tab: tab_name,
16
+ page: page_num,
17
+ args: args_obj
18
+ }, function() {
19
+ container.removeClass('wp-review-tab-loading');
20
+ tab_content.data('loaded', 1).hide().fadeIn().siblings().hide();
21
+ }
22
+ );
23
+ }
24
+ } else {
25
+ tab_content.fadeIn().siblings().hide();
26
+ }
27
+ }
28
+
29
+ jQuery(document).ready(function() {
30
+ jQuery('.wp_review_tab_widget_content').each(function() {
31
+ var $this = jQuery(this);
32
+ var widget_id = this.id;
33
+ var args = $this.data('args');
34
+
35
+ // load tab content on click
36
+ $this.find('.wp-review-tabs a').click(function(e) {
37
+ e.preventDefault();
38
+ jQuery(this).parent().addClass('selected').siblings().removeClass('selected');
39
+ var tab_name = this.id.slice(0, -4); // -tab
40
+ wp_review_tab_loadTabContent(tab_name, 1, $this, args);
41
+ });
42
+
43
+ // pagination
44
+ $this.on('click', '.wp-review-tab-pagination a', function(e) {
45
+ e.preventDefault();
46
+ var $this_a = jQuery(this);
47
+ var tab_name = $this_a.closest('.tab-content').attr('id').slice(0, -12); // -tab-content
48
+ var page_num = parseInt($this_a.closest('.tab-content').children('.page_num').val());
49
+
50
+ if ($this_a.hasClass('next')) {
51
+ wp_review_tab_loadTabContent(tab_name, page_num + 1, $this, args);
52
+ } else {
53
+ $this.find('#'+tab_name+'-tab-content').data('loaded', 0);
54
+ wp_review_tab_loadTabContent(tab_name, page_num - 1, $this, args);
55
+ }
56
+
57
+ });
58
+
59
+ // load first tab now
60
+ $this.find('.wp-review-tabs a').first().click();
61
+ });
62
+
63
+ });
includes/enqueue.php CHANGED
File without changes
includes/functions.php CHANGED
@@ -1,482 +1,499 @@
1
- <?php
2
- ob_start();
3
- /**
4
- * WP Review
5
- *
6
- * @since 2.0
7
- * @copyright Copyright (c) 2013, MyThemesShop
8
- * @author MyThemesShop
9
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
- */
11
-
12
- /* Display the meta box data below 'the_content' hook. */
13
- add_filter( 'the_content', 'wp_review_inject_data' );
14
-
15
- /* Custom review color. */
16
- add_action( 'wp_head', 'wp_review_color_output', 20 );
17
-
18
- /* Get review with Ajax */
19
- add_action('wp_ajax_mts_review_get_review', 'mts_review_get_review');
20
- add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review');
21
-
22
- /* Show with shortcode */
23
- add_shortcode('wp-review', 'wp_review_get_data');
24
- add_shortcode('wp-review-total', 'wp_review_total_shortcode');
25
-
26
- // image sizes for the widgets
27
- //add_image_size( 'wp_review_big', 320, 200, true );
28
- //add_image_size( 'wp_review_small', 65, 65, true );
29
-
30
- /**
31
- * Set new default colors for the WP Review meta boxes.
32
- * Passed array doesn't have to contain all values,
33
- * it is possible to change values separately, eg.
34
- * wp_review_set_default_colors( array( 'font_color' => '#222222' ) );
35
- *
36
- * To be used in themes & plugins.
37
- *
38
- * @since 1.0
39
- *
40
- */
41
- function wp_review_set_default_colors( $colors = array() ) {
42
- $current_colors = get_option('wp_review_default_colors', $defaultColors);
43
- $colors = wp_parse_args($colors, $current_colors);
44
- update_option('wp_review_default_colors', $colors);
45
- }
46
-
47
-
48
- /**
49
- * Get the meta box data.
50
- *
51
- * @since 1.0
52
- *
53
- */
54
- function wp_review_get_data() {
55
- global $post;
56
- global $blog_id;
57
-
58
- /* Retrieve the meta box data. */
59
- $heading = get_post_meta( $post->ID, 'wp_review_heading', true );
60
- $desc = get_post_meta( $post->ID, 'wp_review_desc', true );
61
- $items = get_post_meta( $post->ID, 'wp_review_item', true );
62
- $type = get_post_meta( $post->ID, 'wp_review_type', true );
63
- $total = get_post_meta( $post->ID, 'wp_review_total', true );
64
- $allowUsers = get_post_meta( $post->ID, 'wp_review_userReview', true );
65
-
66
- /* Define a custom class for bar type. */
67
- $class = '';
68
- if ( 'point' == $type ) {
69
- $class = 'bar-point';
70
- } elseif ( 'percentage' == $type ) {
71
- $class = 'percentage-point';
72
- }
73
- $post_types = get_post_types( array('public' => true), 'names' );
74
- $excluded_post_types = array('attachment');
75
- $allowed_post_types = array();
76
- foreach ($post_types as $i => $post_type) {
77
- if (!in_array($post_type, $excluded_post_types)) {
78
- $allowed_post_types[] = $post_type;
79
- }
80
- }
81
-
82
- /**
83
- * Add the custom data from the meta box to the main query an
84
- * make sure the hook only apply on single post.
85
- */
86
- if ( $type != '' && is_singular($allowed_post_types) && is_main_query() ) {
87
-
88
-
89
- $review = '<div id="review" class="review-wrapper ' . $class . '" >';
90
-
91
- /* Review title. */
92
- if( $heading != '' ){
93
- $review .= '<h5 class="review-title">' . __( $heading ) . '</h5>';
94
- }
95
-
96
-
97
- /* Review item. */
98
- if ( $items ) {
99
- $review .= '<ul class="review-list">';
100
- foreach( $items as $item ) {
101
-
102
- $item['wp_review_item_title'] = ( !empty( $item['wp_review_item_title'] ) ) ? $item['wp_review_item_title'] : '';
103
- $item['wp_review_item_star'] = ( !empty( $item['wp_review_item_star'] ) ) ? $item['wp_review_item_star'] : '';
104
-
105
- if ( 'star' == $type ) {
106
- $result = $item['wp_review_item_star'] * 20;
107
- $bestresult = '<meta itemprop="best" content="5"/>';
108
- $best = '5';
109
- } elseif( 'point' == $type ) {
110
- $result = $item['wp_review_item_star'] * 10;
111
- $bestresult = '<meta itemprop="best" content="10"/>';
112
- $best = '10';
113
- } else {
114
- $result = $item['wp_review_item_star'] * 100 / 100;
115
- $bestresult = '<meta itemprop="best" content="100"/>';
116
- $best = '100';
117
- }
118
-
119
- $review .= '<li>';
120
-
121
- if ( 'point' == $type ) {
122
- $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . ' - ' . $item['wp_review_item_star'] . '</span>';
123
- } elseif( 'percentage' == $type ) {
124
- $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . ' - ' . $item['wp_review_item_star'] . '%' . '</span>';
125
- } else {
126
- $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . '</span>';
127
- }
128
-
129
- $review .= '<div class="review-star">';
130
- $review .= '<div class="review-result-wrapper">';
131
-
132
- if ( 'star' == $type ) {
133
- $review .= '<i class="mts-icon-star"></i>';
134
- $review .= '<i class="mts-icon-star"></i>';
135
- $review .= '<i class="mts-icon-star"></i>';
136
- $review .= '<i class="mts-icon-star"></i>';
137
- $review .= '<i class="mts-icon-star"></i>';
138
- $review .= '<div class="review-result" style="width:' . $result . '%;">';
139
- $review .= '<i class="mts-icon-star"></i>';
140
- $review .= '<i class="mts-icon-star"></i>';
141
- $review .= '<i class="mts-icon-star"></i>';
142
- $review .= '<i class="mts-icon-star"></i>';
143
- $review .= '<i class="mts-icon-star"></i>';
144
- $review .= '</div><!-- .review-result -->';
145
- } elseif ( 'point' == $type ) {
146
- $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '</div>';
147
- } else {
148
- $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '</div>';
149
- }
150
-
151
- $review .= '</div><!-- .review-result-wrapper -->';
152
- $review .= '</div><!-- .review-star -->';
153
- $review .= '</li>';
154
-
155
- }
156
- $review .= '</ul>';
157
- }
158
-
159
- /* Review description. */
160
- if ( $desc ) {
161
- $review .= '<div class="review-desc" >';
162
- $review .= '<p class="review-summary-title"><strong>' . __( 'Summary', 'mts-review' ) . '</strong></p>';
163
- $review .= wp_kses_post( wpautop( $desc ) );
164
- $review .= '</div><!-- .review-desc -->';
165
-
166
- }//**END IF HAS DESCRIPTION**
167
- if( $total != '' ){
168
- $review .= '<div class="review-total-wrapper"> ';
169
-
170
- if ( 'percentage' == $type ) {
171
- $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
172
- } elseif ( 'point' == $type ) {
173
- $review .= '<span class="review-total-box" itemprop="review">' . $total . '/'.__('10','mts-review').'</span></span>';
174
- } else {
175
- $review .= '<span class="review-total-box" itemprop="review">' . $total . '</span></span>';
176
- }
177
-
178
- if ( 'star' == $type ) {
179
- $review .= '<div class="review-total-star">';
180
- $review .= '<div class="review-result-wrapper">';
181
- $review .= '<i class="mts-icon-star"></i>';
182
- $review .= '<i class="mts-icon-star"></i>';
183
- $review .= '<i class="mts-icon-star"></i>';
184
- $review .= '<i class="mts-icon-star"></i>';
185
- $review .= '<i class="mts-icon-star"></i>';
186
- $review .= '<div class="review-result" style="width:' . $total*20 . '%;">';
187
- $review .= '<i class="mts-icon-star"></i>';
188
- $review .= '<i class="mts-icon-star"></i>';
189
- $review .= '<i class="mts-icon-star"></i>';
190
- $review .= '<i class="mts-icon-star"></i>';
191
- $review .= '<i class="mts-icon-star"></i>';
192
- $review .= '</div><!-- .review-result -->';
193
- $review .= '</div><!-- .review-result-wrapper -->';
194
- $review .= '</div><!-- .review-star -->';
195
- }
196
-
197
- $review .= '</div>';
198
-
199
-
200
- $review .= '<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Review">
201
- <meta itemprop="itemreviewed" content="'.__( $heading ).'">
202
-
203
- <span itemprop="rating" itemscope="itemscope"itemtype="http://data-vocabulary.org/Rating">
204
- <meta itemprop="value" content="'.$total.'">
205
- <meta itemprop="best" content="'.$best.'">
206
- </span>
207
- <span itemprop="reviewer" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
208
- <meta itemprop="name" content="'. get_the_author() .'">
209
- </span>
210
- </div>';
211
- }
212
-
213
- /**
214
- * USERS REVIEW AREA
215
- */
216
-
217
- if( is_array( $allowUsers ) && $allowUsers[0] == 1 ){
218
- $allowedClass = 'allowed-to-rate';
219
- $hasNotRatedClass = 'has-not-rated-yet';
220
- $postReviews = mts_get_post_reviews( $post->ID );
221
- $userTotal = $postReviews[0]->reviewsAvg;
222
- $usersReviewsCount = $postReviews[0]->reviewsNum;
223
-
224
- $review .= '<div style="clear: both;"></div>';
225
-
226
- $review .= '<div class="user-review-area">';
227
-
228
- //$ip = $_SERVER['REMOTE_ADDR'];
229
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
230
- $ip = $_SERVER['HTTP_CLIENT_IP'];
231
- } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
232
- $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
233
- } else {
234
- $ip = $_SERVER['REMOTE_ADDR'];
235
- }
236
- $user_id = '';
237
- if ( is_user_logged_in() ) { $user_id = get_current_user_id(); }
238
- //echo $blog_id;
239
- $review .= '<input type="hidden" id="blog_id" value="'.$blog_id.'">';
240
- $review .= '<input type="hidden" id="post_id" value="'.$post->ID.'">';
241
- $review .= '<input type="hidden" id="user_id" value="'.$user_id.'">';
242
- $review .= '<input type="hidden" id="mts-userIP" value="'.$ip.'">';
243
-
244
- if( $userTotal == '' ) $userTotal = '0.0';
245
- $review .= '<div class="user-total-wrapper"><span class="user-review-title">'.__('User Rating','mts-review').': </span><span class="review-total-box"><span id="mts-user-reviews-total">' . $userTotal . '</span> ';
246
- $review.= '<small>(<span id="mts-user-reviews-counter" >'.$usersReviewsCount.'</span> '.__('votes', 'mts-review').')</small></span></div>';
247
-
248
- if( hasPreviousReview( $post->ID, $user_id, $ip )) {
249
- $hasNotRatedClass = '';
250
- }
251
-
252
- $review .= '<div class="review-total-star '.$allowedClass.' '.$hasNotRatedClass.'" >';
253
- $review .='<div class="mts-review-wait-msg"><span class="animate-spin mts-icon-loader"></span>'.__('Sending','mts-review').'</div>';
254
- $review .= '<div class="review-result-wrapper">';
255
- $review .= '<a data-input-value="1" title="1/5"><i class="mts-icon-star"></i></a>';
256
- $review .= '<a data-input-value="2" title="2/5"><i class="mts-icon-star"></i></a>';
257
- $review .= '<a data-input-value="3" title="3/5"><i class="mts-icon-star"></i></a>';
258
- $review .= '<a data-input-value="4" title="4/5"><i class="mts-icon-star"></i></a>';
259
- $review .= '<a data-input-value="5" title="5/5"><i class="mts-icon-star"></i></a>';
260
- $review .= '<div class="review-result" style="width:' . $userTotal*20 . '%;">';
261
- $review .= '<i class="mts-icon-star"></i>';
262
- $review .= '<i class="mts-icon-star"></i>';
263
- $review .= '<i class="mts-icon-star"></i>';
264
- $review .= '<i class="mts-icon-star" style=""></i>';
265
- $review .= '<i class="mts-icon-star"></i>';
266
- $review .= '</div><!-- .review-result -->';
267
- $review .= '</div><!-- .review-result-wrapper -->';
268
- $review .= '</div><!-- .review-star -->';
269
- $review .= '<input type="hidden" id="mts-review-user-rate" value="" />';
270
-
271
- $review .= '</div>';
272
-
273
- $review .= '<div itemscope itemtype="http://schema.org/Review">
274
- <div itemprop="reviewRating" itemscope itemtype="http://schema.org/AggregateRating">
275
- <meta itemprop="ratingValue" content="'.$userTotal.'" />
276
- <meta itemprop="bestRating" content="5"/>
277
- <meta itemprop="ratingCount" content="'.$usersReviewsCount.'" />
278
- </div>
279
- </div>';
280
-
281
- }//**END IF USERS ALLOWED TO RATE**
282
-
283
-
284
- $review .= '</div><!-- #review -->';
285
-
286
- return $review;
287
- } else {
288
- return '';
289
- }
290
- }
291
-
292
- function wp_review_inject_data( $content ) {
293
- global $post;
294
- $location = get_post_meta( $post->ID, 'wp_review_location', true );
295
- if (empty($location) || $location == 'custom') {
296
- return $content;
297
- }
298
-
299
- $review = wp_review_get_data();
300
- if ( 'bottom' == $location ) {
301
- return $content .= $review;
302
- } elseif ( 'top' == $location ) {
303
- return $review .= $content;
304
- } else {
305
- return $content;
306
- }
307
- }
308
-
309
- /**
310
- * Retrieve only total rating.
311
- * To be used on archive pages, etc.
312
- *
313
- * @since 1.0
314
- *
315
- */
316
- function wp_review_show_total($echo = true, $class = 'review-total-only') {
317
- global $post;
318
- $type = get_post_meta( $post->ID, 'wp_review_type', true );
319
- $total = get_post_meta( $post->ID, 'wp_review_total', true );
320
- $review = '';
321
-
322
- if (!empty($type) && !empty($total)) {
323
- wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.0', 'all' );
324
-
325
- $review = '<div class="review-type-'.$type.' '.esc_attr($class).'"> ';
326
-
327
- if ( 'percentage' == $type ) {
328
- $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
329
- } elseif ( 'point' == $type ) {
330
- $review .= '<span class="review-total-box" itemprop="review">' . $total . '</span>/'.__('10','mts-review').'</span>';
331
- } else {
332
- // star
333
- $review .= '<div class="review-total-star">';
334
- $review .= '<div class="review-result-wrapper">';
335
- $review .= '<i class="mts-icon-star"></i>';
336
- $review .= '<i class="mts-icon-star"></i>';
337
- $review .= '<i class="mts-icon-star"></i>';
338
- $review .= '<i class="mts-icon-star"></i>';
339
- $review .= '<i class="mts-icon-star"></i>';
340
- $review .= '<div class="review-result" style="width:' . $total*22 . '%;">';
341
- $review .= '<i class="mts-icon-star"></i>';
342
- $review .= '<i class="mts-icon-star"></i>';
343
- $review .= '<i class="mts-icon-star"></i>';
344
- $review .= '<i class="mts-icon-star"></i>';
345
- $review .= '<i class="mts-icon-star"></i>';
346
- $review .= '</div><!-- .review-result -->';
347
- $review .= '</div><!-- .review-result-wrapper -->';
348
- $review .= '</div><!-- .review-star -->';
349
- }
350
-
351
- $review .= '</div>';
352
- }
353
-
354
- if ($echo)
355
- echo $review;
356
- else
357
- return $review;
358
- }
359
- function wp_review_total_shortcode($atts, $content) {
360
- if (empty($atts['class']))
361
- $atts['class'] = 'review-total-only review-total-shortcode';
362
-
363
- return wp_review_show_total(false, $atts['class']);
364
- }
365
-
366
- function mts_get_post_reviews( $post_id ){
367
- if( is_numeric( $post_id ) && $post_id > 0 ){
368
- global $wpdb;
369
- global $blog_id;
370
- $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
371
- if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
372
- $reviews = $wpdb->get_results( $wpdb->prepare("SELECT ROUND( AVG(rate) ,1 ) as reviewsAvg, COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d'", $blog_id, $post_id) );
373
- return $reviews;
374
- }
375
- }
376
-
377
-
378
- /**
379
- * Star review color
380
- *
381
- * @since 1.0
382
- */
383
- function wp_review_color_output() {
384
- global $post;
385
-
386
- /* Retrieve the meta box data. */
387
- if(is_singular()) {
388
- $color = get_post_meta( $post->ID, 'wp_review_color', true );
389
- $type = get_post_meta( $post->ID, 'wp_review_type', true );
390
- $fontcolor = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
391
- $bgcolor1 = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
392
- $bgcolor2 = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
393
- $bordercolor = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
394
- $total = get_post_meta( $post->ID, 'wp_review_total', true );
395
-
396
- if( !$color ) $color = '#333333';
397
-
398
- if( $color ) {
399
- echo '<style type="text/css">';
400
-
401
- if ( 'star' == $type ) { ?>
402
-
403
- .review-result-wrapper .review-result i { color: <?php echo $color; ?>; opacity: 1; filter: alpha(opacity=100); }
404
- .review-result-wrapper i{ color: <?php echo $color; ?>; opacity: 0.50; filter: alpha(opacity=50); }
405
-
406
- <?php } elseif ( 'point' == $type ) { ?>
407
-
408
- .bar-point .review-result { background-color: <?php echo $color; ?>; }
409
-
410
- <?php } else { ?>
411
-
412
- .percentage-point .review-result { background-color: <?php echo $color; ?>; }
413
-
414
- <?php }
415
- ?>
416
- .review-wrapper, .review-title, .review-desc p{ color: <?php echo $fontcolor; ?>;}
417
- .review-list li, .review-wrapper{ background: <?php echo $bgcolor2; ?>;}
418
- .review-title, .review-list li:nth-child(2n){background: <?php echo $bgcolor1; ?>;}
419
-
420
- .bar-point .allowed-to-rate .review-result, .percentage-point .allowed-to-rate .review-result{background: none;}
421
- .review-total-star.allowed-to-rate a i { color: <?php echo $color; ?>; opacity: 0.50; filter: alpha(opacity=50); }
422
- .bar-point .allowed-to-rate .review-result, .percentage-point .allowed-to-rate .review-result{text-indent:0;}
423
- .bar-point .allowed-to-rate .review-result i, .percentage-point .allowed-to-rate .review-result i, .mts-user-review-star-container .selected i { color: <?php echo $color; ?>; opacity: 1; filter: alpha(opacity=100); }
424
- .review-wrapper, .review-title, .review-list li, .review-list li:last-child, .user-review-area{border-color: <?php echo $bordercolor; ?>;}
425
- <?php
426
- if( $total == '' ){?>
427
- .user-review-area{border: 1px solid <?php echo $bordercolor; ?>; margin-top: 0px;}
428
- .review-desc{width: 100%;}
429
- .review-wrapper{border: none; overflow: visible;}
430
- <?php }
431
- echo '</style>';
432
- }
433
- }
434
- }
435
-
436
- /**
437
- *Check if user has reviewed this post previously
438
- */
439
- function hasPreviousReview( $post_id, $user_id, $ip ){
440
- if( is_numeric( $post_id ) && $post_id > 0 ){
441
- global $wpdb;
442
- global $blog_id;
443
- $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
444
- if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
445
- if( is_numeric( $user_id ) && $user_id > 0 ){
446
- $prevRates = $wpdb->get_row( $wpdb->prepare("SELECT COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d' AND user_id = '%d'", $blog_id, $post_id, $user_id) );
447
- if( $prevRates->reviewsNum > 0 ) return true; else return false;
448
- }
449
- elseif( $ip != '' ){
450
- $prevRates = $wpdb->get_row( $wpdb->prepare("SELECT COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d' AND user_ip = '%s' AND user_id = '0'", $blog_id, $post_id, $ip) );
451
- if( $prevRates->reviewsNum > 0 ) return true; else return false;
452
- }
453
- else return false;
454
- }
455
- return false;
456
- }
457
-
458
-
459
- /**
460
- *Get review with Ajax
461
- */
462
- function mts_review_get_review(){
463
- global $wpdb;
464
-
465
- $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
466
- if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
467
-
468
- global $blog_id;
469
- $post_id = $_POST['post_id'];
470
- $user_id = $_POST['user_id'];
471
- $uip = $_POST['ip'];
472
- $data = $_POST['review'];
473
-
474
- if( $rows_affected = $wpdb->insert( $table_name, array('blog_id' => $blog_id, 'post_id' => $post_id, 'user_id' => $user_id, 'user_ip' => $uip, 'rate' => $data, 'date' => current_time('mysql')) ) ){
475
- $reviews = $wpdb->get_row( $wpdb->prepare("SELECT ROUND( AVG(rate) ,1 ) as reviewsAvg, COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d'", $blog_id, $post_id) );
476
- echo $reviews->reviewsAvg.'|'.$reviews->reviewsNum;
477
- }
478
- else echo 'MTS_REVIEW_DB_ERROR';
479
- exit;
480
- }
481
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
482
  ?>
1
+ <?php
2
+ ob_start();
3
+ /**
4
+ * WP Review
5
+ *
6
+ * @since 2.0
7
+ * @copyright Copyright (c) 2013, MyThemesShop
8
+ * @author MyThemesShop
9
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
+ */
11
+
12
+ /* Display the meta box data below 'the_content' hook. */
13
+ add_filter( 'the_content', 'wp_review_inject_data' );
14
+
15
+ /* Custom review color. */
16
+ add_action( 'wp_head', 'wp_review_color_output', 20 );
17
+
18
+ /* Get review with Ajax */
19
+ add_action('wp_ajax_mts_review_get_review', 'mts_review_get_review');
20
+ add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review');
21
+
22
+ /* Show with shortcode */
23
+ add_shortcode('wp-review', 'wp_review_get_data');
24
+ add_shortcode('wp-review-total', 'wp_review_total_shortcode');
25
+
26
+ // image sizes for the widgets
27
+ add_image_size( 'wp_review_large', 320, 200, true );
28
+ add_image_size( 'wp_review_small', 65, 65, true );
29
+
30
+ /**
31
+ * Get the meta box data.
32
+ *
33
+ * @since 1.0
34
+ *
35
+ */
36
+ function wp_review_get_data() {
37
+ global $post;
38
+ global $blog_id;
39
+
40
+ /* Retrieve the meta box data. */
41
+ $heading = get_post_meta( $post->ID, 'wp_review_heading', true );
42
+ $desc = get_post_meta( $post->ID, 'wp_review_desc', true );
43
+ $items = get_post_meta( $post->ID, 'wp_review_item', true );
44
+ $type = get_post_meta( $post->ID, 'wp_review_type', true );
45
+ $total = get_post_meta( $post->ID, 'wp_review_total', true );
46
+ $allowUsers = get_post_meta( $post->ID, 'wp_review_userReview', true );
47
+
48
+ /* Define a custom class for bar type. */
49
+ $class = '';
50
+ if ( 'point' == $type ) {
51
+ $class = 'bar-point';
52
+ } elseif ( 'percentage' == $type ) {
53
+ $class = 'percentage-point';
54
+ }
55
+ $post_types = get_post_types( array('public' => true), 'names' );
56
+ $excluded_post_types = array('attachment');
57
+ $allowed_post_types = array();
58
+ foreach ($post_types as $i => $post_type) {
59
+ if (!in_array($post_type, $excluded_post_types)) {
60
+ $allowed_post_types[] = $post_type;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Add the custom data from the meta box to the main query an
66
+ * make sure the hook only apply on single post.
67
+ */
68
+ if ( $type != '' && is_singular($allowed_post_types) && is_main_query() ) {
69
+
70
+
71
+ $review = '<div id="review" class="review-wrapper ' . $class . '" >';
72
+
73
+ /* Review title. */
74
+ if( $heading != '' ){
75
+ $review .= '<h5 class="review-title">' . __( $heading ) . '</h5>';
76
+ }
77
+
78
+
79
+ /* Review item. */
80
+ if ( $items ) {
81
+ $review .= '<ul class="review-list">';
82
+ foreach( $items as $item ) {
83
+
84
+ $item['wp_review_item_title'] = ( !empty( $item['wp_review_item_title'] ) ) ? $item['wp_review_item_title'] : '';
85
+ $item['wp_review_item_star'] = ( !empty( $item['wp_review_item_star'] ) ) ? $item['wp_review_item_star'] : '';
86
+
87
+ if ( 'star' == $type ) {
88
+ $result = $item['wp_review_item_star'] * 20;
89
+ $bestresult = '<meta itemprop="best" content="5"/>';
90
+ $best = '5';
91
+ } elseif( 'point' == $type ) {
92
+ $result = $item['wp_review_item_star'] * 10;
93
+ $bestresult = '<meta itemprop="best" content="10"/>';
94
+ $best = '10';
95
+ } else {
96
+ $result = $item['wp_review_item_star'] * 100 / 100;
97
+ $bestresult = '<meta itemprop="best" content="100"/>';
98
+ $best = '100';
99
+ }
100
+
101
+ $review .= '<li>';
102
+
103
+ if ( 'point' == $type ) {
104
+ $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . ' - ' . $item['wp_review_item_star'] . '/10</span>';
105
+ } elseif( 'percentage' == $type ) {
106
+ $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . ' - ' . $item['wp_review_item_star'] . '%' . '</span>';
107
+ } else {
108
+ $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . '</span>';
109
+ }
110
+
111
+ $review .= '<div class="review-star">';
112
+ $review .= '<div class="review-result-wrapper">';
113
+
114
+ if ( 'star' == $type ) {
115
+ $review .= '<i class="mts-icon-star"></i>';
116
+ $review .= '<i class="mts-icon-star"></i>';
117
+ $review .= '<i class="mts-icon-star"></i>';
118
+ $review .= '<i class="mts-icon-star"></i>';
119
+ $review .= '<i class="mts-icon-star"></i>';
120
+ $review .= '<div class="review-result" style="width:' . $result . '%;">';
121
+ $review .= '<i class="mts-icon-star"></i>';
122
+ $review .= '<i class="mts-icon-star"></i>';
123
+ $review .= '<i class="mts-icon-star"></i>';
124
+ $review .= '<i class="mts-icon-star"></i>';
125
+ $review .= '<i class="mts-icon-star"></i>';
126
+ $review .= '</div><!-- .review-result -->';
127
+ } elseif ( 'point' == $type ) {
128
+ $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '/10</div>';
129
+ } else {
130
+ $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '</div>';
131
+ }
132
+
133
+ $review .= '</div><!-- .review-result-wrapper -->';
134
+ $review .= '</div><!-- .review-star -->';
135
+ $review .= '</li>';
136
+
137
+ }
138
+ $review .= '</ul>';
139
+ }
140
+
141
+ /* Review description. */
142
+ if ( $desc ) {
143
+ $review .= '<div class="review-desc" >';
144
+ $review .= '<p class="review-summary-title"><strong>' . __( 'Summary', 'mts-review' ) . '</strong></p>';
145
+ $review .= do_shortcode ( shortcode_unautop( wp_kses_post( wpautop( $desc ) ) ) );
146
+ $review .= '</div><!-- .review-desc -->';
147
+
148
+ }//**END IF HAS DESCRIPTION**
149
+ if( $total != '' ){
150
+ $review .= '<div class="review-total-wrapper"> ';
151
+
152
+ if ( 'percentage' == $type ) {
153
+ $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
154
+ }
155
+
156
+ if ( 'point' == $type ) {
157
+ $review .= '<span class="review-total-box" itemprop="review">' . $total . '/10</span></span>';
158
+ }
159
+
160
+ if ( 'star' == $type ) {
161
+ $review .= '<div class="review-total-star">';
162
+ $review .= '<div class="review-result-wrapper">';
163
+ $review .= '<i class="mts-icon-star"></i>';
164
+ $review .= '<i class="mts-icon-star"></i>';
165
+ $review .= '<i class="mts-icon-star"></i>';
166
+ $review .= '<i class="mts-icon-star"></i>';
167
+ $review .= '<i class="mts-icon-star"></i>';
168
+ $review .= '<div class="review-result" style="width:' . $total*20 . '%;">';
169
+ $review .= '<i class="mts-icon-star"></i>';
170
+ $review .= '<i class="mts-icon-star"></i>';
171
+ $review .= '<i class="mts-icon-star"></i>';
172
+ $review .= '<i class="mts-icon-star"></i>';
173
+ $review .= '<i class="mts-icon-star"></i>';
174
+ $review .= '</div><!-- .review-result -->';
175
+ $review .= '</div><!-- .review-result-wrapper -->';
176
+ $review .= '</div><!-- .review-star -->';
177
+ }
178
+
179
+ $review .= '</div>';
180
+
181
+
182
+ $review .= '<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Review">
183
+ <meta itemprop="itemreviewed" content="'.__( $heading ).'">
184
+
185
+ <span itemprop="rating" itemscope="itemscope"itemtype="http://data-vocabulary.org/Rating">
186
+ <meta itemprop="value" content="'.$total.'">
187
+ <meta itemprop="best" content="'.$best.'">
188
+ </span>
189
+ <span itemprop="reviewer" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
190
+ <meta itemprop="name" content="'. get_the_author() .'">
191
+ </span>
192
+ </div>';
193
+ }
194
+
195
+ /**
196
+ * USERS REVIEW AREA
197
+ */
198
+
199
+ if( is_array( $allowUsers ) && $allowUsers[0] == 1 ){
200
+ $allowedClass = 'allowed-to-rate';
201
+ $hasNotRatedClass = 'has-not-rated-yet';
202
+ $postReviews = mts_get_post_reviews( $post->ID );
203
+ $userTotal = $postReviews[0]->reviewsAvg;
204
+ $usersReviewsCount = $postReviews[0]->reviewsNum;
205
+
206
+ $review .= '<div style="clear: both;"></div>';
207
+
208
+ $review .= '<div class="user-review-area">';
209
+ //$ip = $_SERVER['REMOTE_ADDR'];
210
+ if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
211
+ $ip = $_SERVER['HTTP_CLIENT_IP'];
212
+ } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
213
+ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
214
+ } else {
215
+ $ip = $_SERVER['REMOTE_ADDR'];
216
+ }
217
+
218
+ $user_id = '';
219
+ if ( is_user_logged_in() ) { $user_id = get_current_user_id(); }
220
+ //echo $blog_id;
221
+ $review .= '<input type="hidden" id="blog_id" value="'.$blog_id.'">';
222
+ $review .= '<input type="hidden" id="post_id" value="'.$post->ID.'">';
223
+ $review .= '<input type="hidden" id="user_id" value="'.$user_id.'">';
224
+ $review .= '<input type="hidden" id="token" value="'.wp_create_nonce( "wp-review-security" ).'">';
225
+
226
+
227
+ if( $userTotal == '' ) $userTotal = '0.0';
228
+ $review .= '<div class="user-total-wrapper"><span class="user-review-title">'.__('User Rating','mts-review').': </span><span class="review-total-box"><span id="mts-user-reviews-total">' . $userTotal . '</span> ';
229
+ $review.= '<small>(<span id="mts-user-reviews-counter" >'.$usersReviewsCount.'</span> '.__('votes', 'mts-review').')</small></span></div>';
230
+
231
+ if( hasPreviousReview( $post->ID, $user_id, $ip )) {
232
+ $hasNotRatedClass = '';
233
+ }
234
+
235
+ $review .= '<div class="review-total-star '.$allowedClass.' '.$hasNotRatedClass.'" >';
236
+ $review .='<div class="mts-review-wait-msg"><span class="animate-spin mts-icon-loader"></span>'.__('Sending','mts-review').'</div>';
237
+ $review .= '<div class="review-result-wrapper">';
238
+ $review .= '<a data-input-value="1" title="1/5"><i class="mts-icon-star"></i></a>';
239
+ $review .= '<a data-input-value="2" title="2/5"><i class="mts-icon-star"></i></a>';
240
+ $review .= '<a data-input-value="3" title="3/5"><i class="mts-icon-star"></i></a>';
241
+ $review .= '<a data-input-value="4" title="4/5"><i class="mts-icon-star"></i></a>';
242
+ $review .= '<a data-input-value="5" title="5/5"><i class="mts-icon-star"></i></a>';
243
+ $review .= '<div class="review-result" style="width:' . $userTotal*20 . '%;">';
244
+ $review .= '<i class="mts-icon-star"></i>';
245
+ $review .= '<i class="mts-icon-star"></i>';
246
+ $review .= '<i class="mts-icon-star"></i>';
247
+ $review .= '<i class="mts-icon-star" style=""></i>';
248
+ $review .= '<i class="mts-icon-star"></i>';
249
+ $review .= '</div><!-- .review-result -->';
250
+ $review .= '</div><!-- .review-result-wrapper -->';
251
+ $review .= '</div><!-- .review-star -->';
252
+ $review .= '<input type="hidden" id="mts-review-user-rate" value="" />';
253
+
254
+ $review .= '</div>';
255
+
256
+ $review .= '<div itemscope itemtype="http://schema.org/Review">
257
+ <div itemprop="reviewRating" itemscope itemtype="http://schema.org/AggregateRating">
258
+ <meta itemprop="ratingValue" content="'.$userTotal.'" />
259
+ <meta itemprop="bestRating" content="5"/>
260
+ <meta itemprop="ratingCount" content="'.$usersReviewsCount.'" />
261
+ </div>
262
+ </div>';
263
+
264
+ }//**END IF USERS ALLOWED TO RATE**
265
+
266
+
267
+ $review .= '</div><!-- #review -->';
268
+
269
+ return $review;
270
+ } else {
271
+ return '';
272
+ }
273
+ }
274
+
275
+ function wp_review_inject_data( $content ) {
276
+ global $post;
277
+ $location = get_post_meta( $post->ID, 'wp_review_location', true );
278
+ $location = apply_filters('wp_review_location', $location, $post->ID);
279
+ if (empty($location) || $location == 'custom') {
280
+ return $content;
281
+ }
282
+ $review = wp_review_get_data();
283
+ if ( 'bottom' == $location ) {
284
+ global $multipage, $numpages, $page;
285
+ if( $multipage ) {
286
+ if ($page == $numpages) {
287
+ return $content .= $review;
288
+ } else {
289
+ return $content;
290
+ }
291
+ } else {
292
+ return $content .= $review;
293
+ }
294
+ } elseif ( 'top' == $location ) {
295
+ return $review .= $content;
296
+ } else {
297
+ return $content;
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Retrieve only total rating.
303
+ * To be used on archive pages, etc.
304
+ *
305
+ * @since 1.0
306
+ *
307
+ */
308
+ function wp_review_show_total($echo = true, $class = 'review-total-only') {
309
+ global $post;
310
+ $type = get_post_meta( $post->ID, 'wp_review_type', true );
311
+ $total = get_post_meta( $post->ID, 'wp_review_total', true );
312
+ $review = '';
313
+
314
+ if (!empty($type) && !empty($total)) {
315
+ wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.0', 'all' );
316
+
317
+ $review = '<div class="review-type-'.$type.' '.esc_attr($class).'"> ';
318
+
319
+ if ( 'percentage' == $type ) {
320
+ $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
321
+ } elseif ( 'point' == $type ) {
322
+ $review .= '<span class="review-total-box" itemprop="review">' . $total . '/10</span></span>';
323
+ } else {
324
+ // star
325
+ $review .= '<div class="review-total-star">';
326
+ $review .= '<div class="review-result-wrapper">';
327
+ $review .= '<i class="mts-icon-star"></i>';
328
+ $review .= '<i class="mts-icon-star"></i>';
329
+ $review .= '<i class="mts-icon-star"></i>';
330
+ $review .= '<i class="mts-icon-star"></i>';
331
+ $review .= '<i class="mts-icon-star"></i>';
332
+ $review .= '<div class="review-result" style="width:' . $total*20 . '%;">';
333
+ $review .= '<i class="mts-icon-star"></i>';
334
+ $review .= '<i class="mts-icon-star"></i>';
335
+ $review .= '<i class="mts-icon-star"></i>';
336
+ $review .= '<i class="mts-icon-star"></i>';
337
+ $review .= '<i class="mts-icon-star"></i>';
338
+ $review .= '</div><!-- .review-result -->';
339
+ $review .= '</div><!-- .review-result-wrapper -->';
340
+ $review .= '</div><!-- .review-star -->';
341
+ }
342
+
343
+ $review .= '</div>';
344
+ }
345
+
346
+ if ($echo)
347
+ echo $review;
348
+ else
349
+ return $review;
350
+ }
351
+ function wp_review_total_shortcode($atts, $content) {
352
+ if (empty($atts['class']))
353
+ $atts['class'] = 'review-total-only review-total-shortcode';
354
+
355
+ return wp_review_show_total(false, $atts['class']);
356
+ }
357
+
358
+ function mts_get_post_reviews( $post_id ){
359
+ if( is_numeric( $post_id ) && $post_id > 0 ){
360
+ global $wpdb;
361
+ global $blog_id;
362
+ $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
363
+ if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
364
+ $reviews = $wpdb->get_results( $wpdb->prepare("SELECT ROUND( AVG(rate) ,1 ) as reviewsAvg, COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d'", $blog_id, $post_id) );
365
+ return $reviews;
366
+ }
367
+ }
368
+
369
+
370
+ /**
371
+ * Star review color
372
+ *
373
+ * @since 1.0
374
+ */
375
+ function wp_review_color_output() {
376
+ global $post;
377
+
378
+ /* Retrieve the meta box data. */
379
+ if(is_singular()) {
380
+ $colors = array();
381
+ $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
382
+ $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
383
+ $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
384
+ $colors['bgcolor1'] = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
385
+ $colors['bgcolor2'] = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
386
+ $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
387
+ $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
388
+
389
+ // Filter for changing colors
390
+ // Post ID gets passed as well
391
+ // Usage:
392
+ // add_filter( 'wp_review_colors', $function_to_add, 10, 2 );
393
+ $colors = apply_filters('wp_review_colors', $colors, $post->ID);
394
+ extract($colors, EXTR_SKIP);
395
+
396
+ if( !$color ) $color = '#333333';
397
+
398
+ if( $color ) {
399
+ echo '<style type="text/css">';
400
+
401
+ if ( 'star' == $type ) { ?>
402
+
403
+ .review-result-wrapper .review-result i { color: <?php echo $color; ?>; opacity: 1; filter: alpha(opacity=100); }
404
+ .review-result-wrapper i{ color: <?php echo $color; ?>; opacity: 0.50; filter: alpha(opacity=50); }
405
+
406
+ <?php } elseif ( 'point' == $type ) { ?>
407
+
408
+ .bar-point .review-result { background-color: <?php echo $color; ?>; }
409
+
410
+ <?php } else { ?>
411
+
412
+ .percentage-point .review-result { background-color: <?php echo $color; ?>; }
413
+
414
+ <?php }
415
+ ?>
416
+ .review-wrapper, .review-title, .review-desc p{ color: <?php echo $fontcolor; ?>;}
417
+ .review-list li, .review-wrapper{ background: <?php echo $bgcolor2; ?>;}
418
+ .review-title, .review-list li:nth-child(2n){background: <?php echo $bgcolor1; ?>;}
419
+
420
+ .bar-point .allowed-to-rate .review-result, .percentage-point .allowed-to-rate .review-result{background: none;}
421
+ .review-total-star.allowed-to-rate a i { color: <?php echo $color; ?>; opacity: 0.50; filter: alpha(opacity=50); }
422
+ .bar-point .allowed-to-rate .review-result, .percentage-point .allowed-to-rate .review-result{text-indent:0;}
423
+ .bar-point .allowed-to-rate .review-result i, .percentage-point .allowed-to-rate .review-result i, .mts-user-review-star-container .selected i { color: <?php echo $color; ?>; opacity: 1; filter: alpha(opacity=100); }
424
+ .review-wrapper, .review-title, .review-list li, .review-list li:last-child, .user-review-area{border-color: <?php echo $bordercolor; ?>;}
425
+ <?php
426
+ if( $total == '' ){?>
427
+ .user-review-area{border: 1px solid <?php echo $bordercolor; ?>; margin-top: 0px;}
428
+ .review-desc{width: 100%;}
429
+ .review-wrapper{border: none; overflow: visible;}
430
+ <?php }
431
+ echo '</style>';
432
+ }
433
+ }
434
+ }
435
+
436
+ /**
437
+ *Check if user has reviewed this post previously
438
+ */
439
+ function hasPreviousReview( $post_id, $user_id, $ip ){
440
+ if( is_numeric( $post_id ) && $post_id > 0 ){
441
+ global $wpdb;
442
+ global $blog_id;
443
+ $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
444
+ if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
445
+ if( is_numeric( $user_id ) && $user_id > 0 ){
446
+ $prevRates = $wpdb->get_row( $wpdb->prepare("SELECT COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d' AND user_id = '%d'", $blog_id, $post_id, $user_id) );
447
+ if( $prevRates->reviewsNum > 0 ) return true; else return false;
448
+ }
449
+ elseif( $ip != '' ){
450
+ $prevRates = $wpdb->get_row( $wpdb->prepare("SELECT COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d' AND user_ip = '%s' AND user_id = '0'", $blog_id, $post_id, $ip) );
451
+ if( $prevRates->reviewsNum > 0 ) return true; else return false;
452
+ }
453
+ else return false;
454
+ }
455
+ return false;
456
+ }
457
+
458
+
459
+ /**
460
+ *Get review with Ajax
461
+ */
462
+ function mts_review_get_review(){
463
+ // security
464
+ check_ajax_referer( 'wp-review-security', 'nonce' );
465
+
466
+ global $wpdb;
467
+
468
+ $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
469
+ if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
470
+
471
+ global $blog_id;
472
+ $post_id = intval($_POST['post_id']);
473
+ $user_id = intval($_POST['user_id']);
474
+
475
+ //$ip = $_SERVER['REMOTE_ADDR'];
476
+ if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
477
+ $uip = $_SERVER['HTTP_CLIENT_IP'];
478
+ } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
479
+ $uip = $_SERVER['HTTP_X_FORWARDED_FOR'];
480
+ } else {
481
+ $uip = $_SERVER['REMOTE_ADDR'];
482
+ }
483
+
484
+ if (!hasPreviousReview($post_id, $user_id, $uip)) {
485
+ $data = intval($_POST['review']);
486
+
487
+ if( $rows_affected = $wpdb->insert( $table_name, array('blog_id' => $blog_id, 'post_id' => $post_id, 'user_id' => $user_id, 'user_ip' => $uip, 'rate' => $data, 'date' => current_time('mysql')) ) ){
488
+ $reviews = $wpdb->get_row( $wpdb->prepare("SELECT ROUND( AVG(rate) ,1 ) as reviewsAvg, COUNT(id) as reviewsNum FROM $table_name WHERE blog_id = '%d' AND post_id = '%d'", $blog_id, $post_id) );
489
+ echo $reviews->reviewsAvg.'|'.$reviews->reviewsNum;
490
+ } else {
491
+ echo 'MTS_REVIEW_DB_ERROR';
492
+ }
493
+ } else {
494
+ echo 'MTS_REVIEW_DB_ERROR';
495
+ }
496
+ exit;
497
+ }
498
+
499
  ?>
includes/widget.php ADDED
@@ -0,0 +1,472 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class wp_review_tab_widget extends WP_Widget {
3
+ function __construct() {
4
+ // ajax functions
5
+ add_action('wp_ajax_wp_review_tab_widget_content', array(&$this, 'ajax_wp_review_tab_widget_content'));
6
+ add_action('wp_ajax_nopriv_wp_review_tab_widget_content', array(&$this, 'ajax_wp_review_tab_widget_content'));
7
+
8
+ // css
9
+ add_action('wp_enqueue_scripts', array(&$this, 'wp_review_tab_register_scripts'));
10
+ add_action('admin_enqueue_scripts', array(&$this, 'wp_review_tab_admin_scripts'));
11
+ add_action('customize_controls_enqueue_scripts', array(&$this, 'wp_review_tab_admin_scripts'));
12
+
13
+ $widget_ops = array('classname' => 'widget_wp_review_tab', 'description' => __('Display Reviews in tabbed format.', 'mts-review'));
14
+ $control_ops = array('width' => 200, 'height' => 350);
15
+ $this->WP_Widget('wp_review_tab_widget', __('WP Review Widget', 'mts-review'), $widget_ops, $control_ops);
16
+ }
17
+ function wp_review_tab_admin_scripts($hook) {
18
+ wp_register_script('wp_review_tab_widget_admin', trailingslashit( WP_REVIEW_ASSETS ).'js/wp-review-tab-widget-admin.js', array('jquery'));
19
+ wp_enqueue_script('wp_review_tab_widget_admin');
20
+ }
21
+ function wp_review_tab_register_scripts() {
22
+ // JS
23
+ wp_enqueue_script('jquery');
24
+ wp_register_script('wp_review_tab_widget', trailingslashit( WP_REVIEW_ASSETS ).'js/wp-review-tab-widget.js', array('jquery'));
25
+ wp_localize_script( 'wp_review_tab_widget', 'wp_review_tab',
26
+ array( 'ajax_url' => admin_url( 'admin-ajax.php' ))
27
+ );
28
+ // CSS
29
+ wp_register_style('wp_review_tab_widget', trailingslashit( WP_REVIEW_ASSETS ).'css/wp-review-tab-widget.css', true);
30
+ }
31
+
32
+ function form( $instance ) {
33
+ $instance = wp_parse_args( (array) $instance, array(
34
+ 'tabs' => array('toprated' => 1, 'recent' => 1, 'mostvoted' => 0, 'custom' => 0),
35
+ 'tab_order' => array('toprated' => 1, 'recent' => 2, 'mostvoted' => 3, 'custom' => 4),
36
+ 'tab_titles' => array('toprated' => __('Top Rated'), 'recent' => __('Recent'), 'mostvoted' => __('Most Voted'), 'custom' => __('Editor\'s choice')),
37
+ 'allow_pagination' => 1,
38
+ 'review_type' => 'any',
39
+ 'post_num' => '5',
40
+ 'comment_num' => '5',
41
+ 'thumb_size' => 'small',
42
+ 'show_date' => 1,
43
+ 'custom_reviews' => ''
44
+ ));
45
+ extract($instance);
46
+ ?>
47
+ <div class="wp_review_tab_options_form">
48
+ <h4><?php _e('Select Tabs', 'mts-review'); ?></h4>
49
+
50
+ <div class="wp_review_tab_select_tabs">
51
+ <label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id("tabs"); ?>_toprated">
52
+ <input type="checkbox" class="checkbox wp_review_tab_enable_toprated" id="<?php echo $this->get_field_id("tabs"); ?>_toprated" name="<?php echo $this->get_field_name("tabs"); ?>[toprated]" value="1" <?php if (isset($tabs['toprated'])) { checked( 1, $tabs['toprated'], true ); } ?> />
53
+ <?php _e( 'Top Rated', 'mts-review'); ?>
54
+ </label>
55
+ <label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id("tabs"); ?>_recent">
56
+ <input type="checkbox" class="checkbox wp_review_tab_enable_recent" id="<?php echo $this->get_field_id("tabs"); ?>_recent" name="<?php echo $this->get_field_name("tabs"); ?>[recent]" value="1" <?php if (isset($tabs['recent'])) { checked( 1, $tabs['recent'], true ); } ?> />
57
+ <?php _e( 'Recent', 'mts-review'); ?>
58
+ </label>
59
+ <label class="alignleft" style="display: block; width: 50%;" for="<?php echo $this->get_field_id("tabs"); ?>_mostvoted">
60
+ <input type="checkbox" class="checkbox wp_review_tab_enable_mostvoted" id="<?php echo $this->get_field_id("tabs"); ?>_mostvoted" name="<?php echo $this->get_field_name("tabs"); ?>[mostvoted]" value="1" <?php if (isset($tabs['mostvoted'])) { checked( 1, $tabs['mostvoted'], true ); } ?> />
61
+ <?php _e( 'Most Voted', 'mts-review'); ?>
62
+ </label>
63
+ <label class="alignleft" style="display: block; width: 50%;" for="<?php echo $this->get_field_id("tabs"); ?>_custom">
64
+ <input type="checkbox" class="checkbox wp_review_tab_enable_custom" id="<?php echo $this->get_field_id("tabs"); ?>_custom" name="<?php echo $this->get_field_name("tabs"); ?>[custom]" value="1" <?php if (isset($tabs['custom'])) { checked( 1, $tabs['custom'], true ); } ?> />
65
+ <?php _e( 'Custom', 'mts-review'); ?>
66
+ </label>
67
+ </div>
68
+ <div class="clear"></div>
69
+
70
+ <div class="wp_review_tab_advanced_options">
71
+
72
+ <p class="wp_review_tab_review_type">
73
+ <label for="<?php echo $this->get_field_id('review_type'); ?>"><?php _e('Review type:', 'mts-review'); ?></label>
74
+ <select id="<?php echo $this->get_field_id('review_type'); ?>" name="<?php echo $this->get_field_name('review_type'); ?>" style="margin-left: 12px;">
75
+ <option value="any" <?php selected($review_type, 'any', true); ?>><?php _e('Any', 'mts-review'); ?></option>
76
+ <option value="star" <?php selected($review_type, 'star', true); ?>><?php _e('Star', 'mts-review'); ?></option>
77
+ <option value="point" <?php selected($review_type, 'point', true); ?>><?php _e('Point', 'mts-review'); ?></option>
78
+ <option value="percentage" <?php selected($review_type, 'percentage', true); ?>><?php _e('Percentage', 'mts-review'); ?></option>
79
+ </select>
80
+ </p>
81
+
82
+ <p>
83
+ <label for="<?php echo $this->get_field_id("allow_pagination"); ?>">
84
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("allow_pagination"); ?>" name="<?php echo $this->get_field_name("allow_pagination"); ?>" value="1" <?php if (isset($allow_pagination)) { checked( 1, $allow_pagination, true ); } ?> />
85
+ <?php _e( 'Allow pagination', 'mts-review'); ?>
86
+ </label>
87
+ </p>
88
+
89
+ <p>
90
+ <label for="<?php echo $this->get_field_id('post_num'); ?>"><?php _e('Number of reviews to show:', 'mts-review'); ?>
91
+ <br />
92
+ <input id="<?php echo $this->get_field_id('post_num'); ?>" name="<?php echo $this->get_field_name('post_num'); ?>" type="number" min="1" step="1" value="<?php echo $post_num; ?>" />
93
+ </label>
94
+ </p>
95
+
96
+ <p class="wp_review_tab_thumbnail_size">
97
+ <label for="<?php echo $this->get_field_id('thumb_size'); ?>"><?php _e('Thumbnail size:', 'mts-review'); ?></label>
98
+ <select id="<?php echo $this->get_field_id('thumb_size'); ?>" name="<?php echo $this->get_field_name('thumb_size'); ?>" style="margin-left: 12px;">
99
+ <option value="small" <?php selected($thumb_size, 'small', true); ?>><?php _e('Small', 'mts-review'); ?></option>
100
+ <option value="large" <?php selected($thumb_size, 'large', true); ?>><?php _e('Large', 'mts-review'); ?></option>
101
+ </select>
102
+ </p>
103
+
104
+ <p>
105
+ <label for="<?php echo $this->get_field_id("show_date"); ?>">
106
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("show_date"); ?>" name="<?php echo $this->get_field_name("show_date"); ?>" value="1" <?php if (isset($show_date)) { checked( 1, $show_date, true ); } ?> />
107
+ <?php _e( 'Show date', 'mts-review'); ?>
108
+ </label>
109
+ </p>
110
+
111
+ <p class="wp_review_tab_custom_reviews"<?php echo (empty($tabs['custom']) ? ' style="display: none;"' : ''); ?>>
112
+ <label for="<?php echo $this->get_field_id('custom_reviews'); ?>"><?php _e('Reviews on Custom tab:', 'mts-review'); ?>
113
+ <br />
114
+ <input id="<?php echo $this->get_field_id('custom_reviews'); ?>" name="<?php echo $this->get_field_name('custom_reviews'); ?>" type="text" value="<?php echo $custom_reviews; ?>" />
115
+ <br />
116
+ <span style="color: #999;">Add IDs, separated by commas, eg. <em>145, 168, 229</em></span>
117
+ </label>
118
+ </p>
119
+
120
+ <div class="clear"></div>
121
+
122
+ <h4><a href="#" class="wp_review_tab_titles_header"><?php _e('Tab Titles', 'mts-review'); ?></a> | <a href="#" class="wp_review_tab_order_header"><?php _e('Tab Order', 'mts-review'); ?></a></h4>
123
+
124
+ <div class="wp_review_tab_order" style="display: none;">
125
+
126
+ <label class="alignleft wp_review_tab_toprated_order" for="<?php echo $this->get_field_id('tab_order'); ?>_toprated" style="width: 50%;<?php echo (empty($tabs['toprated']) ? ' display: none;' : ''); ?>">
127
+ <input id="<?php echo $this->get_field_id('tab_order'); ?>_toprated" name="<?php echo $this->get_field_name('tab_order'); ?>[toprated]" type="number" min="1" step="1" value="<?php echo $tab_order['toprated']; ?>" style="width: 48px;" />
128
+ <?php _e('Top Rated', 'mts-review'); ?>
129
+ </label>
130
+ <label class="alignleft wp_review_tab_recent_order" for="<?php echo $this->get_field_id('tab_order'); ?>_recent" style="width: 50%;<?php echo (empty($tabs['recent']) ? ' display: none;' : ''); ?>">
131
+ <input id="<?php echo $this->get_field_id('tab_order'); ?>_recent" name="<?php echo $this->get_field_name('tab_order'); ?>[recent]" type="number" min="1" step="1" value="<?php echo $tab_order['recent']; ?>" style="width: 48px;" />
132
+ <?php _e('Recent', 'mts-review'); ?>
133
+ </label>
134
+ <label class="alignleft wp_review_tab_mostvoted_order" for="<?php echo $this->get_field_id('tab_order'); ?>_mostvoted" style="width: 50%;<?php echo (empty($tabs['mostvoted']) ? ' display: none;' : ''); ?>">
135
+ <input id="<?php echo $this->get_field_id('tab_order'); ?>_mostvoted" name="<?php echo $this->get_field_name('tab_order'); ?>[mostvoted]" type="number" min="1" step="1" value="<?php echo $tab_order['mostvoted']; ?>" style="width: 48px;" />
136
+ <?php _e('Most Voted', 'mts-review'); ?>
137
+ </label>
138
+ <label class="alignleft wp_review_tab_custom_order" for="<?php echo $this->get_field_id('tab_order'); ?>_custom" style="width: 50%;<?php echo (empty($tabs['custom']) ? ' display: none;' : ''); ?>">
139
+ <input id="<?php echo $this->get_field_id('tab_order'); ?>_custom" name="<?php echo $this->get_field_name('tab_order'); ?>[custom]" type="number" min="1" step="1" value="<?php echo $tab_order['custom']; ?>" style="width: 48px;" />
140
+ <?php _e('Custom', 'mts-review'); ?>
141
+ </label>
142
+ </div>
143
+ <div class="clear" style="margin-bottom: 15px;"></div>
144
+
145
+ <div class="wp_review_tab_titles" style="display: none;">
146
+
147
+ <label class="alignleft wp_review_tab_toprated_title" for="<?php echo $this->get_field_id('tab_titles'); ?>_toprated" style="width: 50%;<?php echo (empty($tabs['toprated']) ? ' display: none;' : ''); ?>">
148
+ <?php _e('Top Rated', 'mts-review'); ?>
149
+ <input id="<?php echo $this->get_field_id('tab_titles'); ?>_toprated" name="<?php echo $this->get_field_name('tab_titles'); ?>[toprated]" type="text" value="<?php echo esc_attr($tab_titles['toprated']); ?>" style="width: 98%;" />
150
+ </label>
151
+ <label class="alignleft wp_review_tab_recent_title" for="<?php echo $this->get_field_id('tab_titles'); ?>_recent" style="width: 50%;<?php echo (empty($tabs['recent']) ? ' display: none;' : ''); ?>">
152
+ <?php _e('Recent', 'mts-review'); ?>
153
+ <input id="<?php echo $this->get_field_id('tab_titles'); ?>_recent" name="<?php echo $this->get_field_name('tab_titles'); ?>[recent]" type="text" value="<?php echo esc_attr($tab_titles['recent']); ?>" style="width: 98%;" />
154
+ </label>
155
+ <label class="alignleft wp_review_tab_mostvoted_title" for="<?php echo $this->get_field_id('tab_titles'); ?>_mostvoted" style="width: 50%;<?php echo (empty($tabs['mostvoted']) ? ' display: none;' : ''); ?>">
156
+ <?php _e('Most Voted', 'mts-review'); ?>
157
+ <input id="<?php echo $this->get_field_id('tab_titles'); ?>_mostvoted" name="<?php echo $this->get_field_name('tab_titles'); ?>[mostvoted]" type="text" value="<?php echo esc_attr($tab_titles['mostvoted']); ?>" style="width: 98%;" />
158
+ </label>
159
+ <label class="alignleft wp_review_tab_custom_title" for="<?php echo $this->get_field_id('tab_titles'); ?>_custom" style="width: 50%;<?php echo (empty($tabs['custom']) ? ' display: none;' : ''); ?>">
160
+ <?php _e('Custom', 'mts-review'); ?>
161
+ <input id="<?php echo $this->get_field_id('tab_titles'); ?>_custom" name="<?php echo $this->get_field_name('tab_titles'); ?>[custom]" type="text" value="<?php echo esc_attr($tab_titles['custom']); ?>" style="width: 98%;" />
162
+ </label>
163
+ </div>
164
+ <div class="clear" style="margin-bottom: 15px;"></div>
165
+
166
+ </div><!-- .wp_review_tab_advanced_options -->
167
+ </div><!-- .wp_review_tab_options_form -->
168
+ <?php
169
+ }
170
+
171
+ function update( $new_instance, $old_instance ) {
172
+ $instance = $old_instance;
173
+ $instance['tabs'] = $new_instance['tabs'];
174
+ $instance['tab_order'] = $new_instance['tab_order'];
175
+ $instance['tab_titles'] = wp_kses_post($new_instance['tab_titles']);
176
+ $instance['review_type'] = $new_instance['review_type'];
177
+ $instance['allow_pagination'] = $new_instance['allow_pagination'];
178
+ $instance['post_num'] = $new_instance['post_num'];
179
+ $instance['thumb_size'] = $new_instance['thumb_size'];
180
+ $instance['show_date'] = $new_instance['show_date'];
181
+ $instance['custom_reviews'] = $new_instance['custom_reviews'];
182
+ return $instance;
183
+ }
184
+ function widget( $args, $instance ) {
185
+ extract($args, EXTR_SKIP);
186
+ extract($instance, EXTR_SKIP);
187
+ wp_enqueue_script('wp_review_tab_widget');
188
+ wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.0', 'all' );
189
+ wp_enqueue_style('wp_review_tab_widget');
190
+ if (empty($tabs)) $tabs = array('recent' => 1, 'toprated' => 1);
191
+ $tabs_count = count($tabs);
192
+ if ($tabs_count <= 1) {
193
+ $tabs_count = 1;
194
+ } elseif($tabs_count > 3) {
195
+ $tabs_count = 4;
196
+ }
197
+
198
+ $available_tabs = array(
199
+ 'toprated' => $tab_titles['toprated'],
200
+ 'recent' => $tab_titles['recent'],
201
+ 'mostvoted' => $tab_titles['mostvoted'],
202
+ 'custom' => $tab_titles['custom']
203
+ );
204
+
205
+ array_multisort($tab_order, $available_tabs);
206
+
207
+ ?>
208
+ <?php echo $before_widget; ?>
209
+ <div class="wp_review_tab_widget_content" id="<?php echo $widget_id; ?>_content">
210
+ <ul class="wp-review-tabs <?php echo "has-$tabs_count-"; ?>tabs">
211
+ <?php foreach ($available_tabs as $tab => $label) : ?>
212
+ <?php if (!empty($tabs[$tab])): ?>
213
+ <li class="tab_title"><a href="#" id="<?php echo $tab; ?>-tab"><?php echo $label; ?></a></li>
214
+ <?php endif; ?>
215
+ <?php endforeach; ?>
216
+ </ul> <!--end .tabs-->
217
+ <div class="clear"></div>
218
+ <div class="inside">
219
+ <?php if (!empty($tabs['toprated'])): ?>
220
+ <div id="toprated-tab-content" class="tab-content">
221
+ </div> <!--end #toprated-tab-content-->
222
+ <?php endif; ?>
223
+ <?php if (!empty($tabs['recent'])): ?>
224
+ <div id="recent-tab-content" class="tab-content">
225
+ </div> <!--end #recent-tab-content-->
226
+ <?php endif; ?>
227
+ <?php if (!empty($tabs['mostvoted'])): ?>
228
+ <div id="mostvoted-tab-content" class="tab-content">
229
+ <ul>
230
+ </ul>
231
+ </div> <!--end #mostvoted-tab-content-->
232
+ <?php endif; ?>
233
+ <?php if (!empty($tabs['custom'])): ?>
234
+ <div id="custom-tab-content" class="tab-content">
235
+ <ul>
236
+ </ul>
237
+ </div> <!--end #custom-tab-content-->
238
+ <?php endif; ?>
239
+ <div class="clear"></div>
240
+ </div> <!--end .inside -->
241
+ <div class="clear"></div>
242
+ </div><!--end #tabber -->
243
+ <?php
244
+ // inline script
245
+ // to support multiple instances per page with different settings
246
+
247
+ unset($instance['tabs'], $instance['tab_order'], $instance['tab_titles']); // unset unneeded
248
+ ?>
249
+ <script type="text/javascript">
250
+ jQuery(function($) {
251
+ $('#<?php echo $widget_id; ?>_content').data('args', <?php echo json_encode($instance); ?>);
252
+ });
253
+ </script>
254
+ <?php echo $after_widget; ?>
255
+ <?php
256
+ }
257
+
258
+ function get_most_voted($limit = 20){
259
+ global $wpdb;
260
+ $limit = intval($limit);
261
+ $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
262
+ if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
263
+
264
+ global $blog_id;
265
+
266
+ $ids = array();
267
+ $reviews = $wpdb->get_results("
268
+ SELECT post_id, COUNT(*) AS magnitude
269
+ FROM $table_name
270
+ WHERE blog_id = $blog_id
271
+ GROUP BY post_id
272
+ ORDER BY magnitude DESC
273
+ LIMIT $limit
274
+ ");
275
+ foreach ($reviews as $review) {
276
+ $ids[] = $review->post_id;
277
+ }
278
+ return $ids;
279
+ }
280
+
281
+ function ajax_wp_review_tab_widget_content() {
282
+ $tab = $_POST['tab'];
283
+ $args = $_POST['args'];
284
+ $page = intval($_POST['page']);
285
+ if ($page < 1)
286
+ $page = 1;
287
+ if (!is_array($args))
288
+ return '';
289
+
290
+ // sanitize args
291
+ $post_num = (empty($args['post_num']) ? 5 : intval($args['post_num']));
292
+ if ($post_num > 20 || $post_num < 1) { // max 20 posts
293
+ $post_num = 5;
294
+ }
295
+
296
+ $thumb_size = $args['thumb_size'];
297
+ if ($thumb_size != 'small' && $thumb_size != 'large') {
298
+ $thumb_size = 'small'; // default
299
+ }
300
+
301
+ $custom_reviews = array();
302
+ if (!empty($args['custom_reviews'])) {
303
+ $custom_reviews = explode(',', $args['custom_reviews']);
304
+ $custom_reviews = array_map('trim', $custom_reviews);
305
+ $custom_reviews = array_map('intval', $custom_reviews);
306
+ }
307
+
308
+ $show_date = !empty($args['show_date']);
309
+ $allow_pagination = !empty($args['allow_pagination']);
310
+ $review_type = '';
311
+ if (in_array($args['review_type'], array('star', 'point', 'percentage'))) {
312
+ $review_type = $args['review_type'];
313
+ }
314
+
315
+ switch ($tab) {
316
+ case "toprated":
317
+ $custom_query = array(
318
+ 'ignore_sticky_posts' => 1,
319
+ 'post_type' => 'any',
320
+ 'posts_per_page' => $post_num,
321
+ 'post_status' => 'publish',
322
+ 'orderby' => 'meta_value_num',
323
+ 'meta_key' => 'wp_review_total',
324
+ 'order' => 'desc',
325
+ 'paged' => $page
326
+ );
327
+ // Meta Query
328
+ $custom_query['meta_query'] = array('relation' => 'AND');
329
+ if (!empty($review_type)) {
330
+ $custom_query['meta_query'][] = array(
331
+ 'key' => 'wp_review_type',
332
+ 'compare' => '=',
333
+ 'value' => $review_type
334
+ );
335
+ } else {
336
+ $custom_query['meta_query'][] = array(
337
+ 'key' => 'wp_review_type',
338
+ 'compare' => '!=',
339
+ 'value' => ''
340
+ );
341
+ }
342
+ break;
343
+
344
+ case "mostvoted":
345
+ $most_voted = $this->get_most_voted();
346
+ $custom_query = array(
347
+ 'ignore_sticky_posts' => 1,
348
+ 'post_type' => 'any',
349
+ 'posts_per_page' => $post_num,
350
+ 'post_status' => 'publish',
351
+ 'orderby' => 'post__in',
352
+ 'post__in' => $most_voted,
353
+ 'paged' => $page
354
+ );
355
+ // Meta Query
356
+ $custom_query['meta_query'] = array('relation' => 'AND');
357
+ if (!empty($review_type)) {
358
+ $custom_query['meta_query'][] = array(
359
+ 'key' => 'wp_review_type',
360
+ 'compare' => '=',
361
+ 'value' => $review_type
362
+ );
363
+ } else {
364
+ $custom_query['meta_query'][] = array(
365
+ 'key' => 'wp_review_type',
366
+ 'compare' => '!=',
367
+ 'value' => ''
368
+ );
369
+ }
370
+ break;
371
+
372
+ case "custom":
373
+ $custom_query = array(
374
+ 'ignore_sticky_posts' => 1,
375
+ 'post_type' => 'any',
376
+ 'posts_per_page' => $post_num,
377
+ 'post_status' => 'publish',
378
+ 'orderby' => 'post__in',
379
+ 'post__in' => $custom_reviews,
380
+ 'paged' => $page
381
+ );
382
+ break;
383
+
384
+ case "recent":
385
+ default:
386
+ $custom_query = array(
387
+ 'ignore_sticky_posts' => 1,
388
+ 'post_type' => 'any',
389
+ 'posts_per_page' => $post_num,
390
+ 'post_status' => 'publish',
391
+ 'orderby' => 'date',
392
+ 'order' => 'desc',
393
+ 'paged' => $page
394
+ );
395
+ // Meta Query
396
+ $custom_query['meta_query'] = array('relation' => 'AND');
397
+ if (!empty($review_type)) {
398
+ $custom_query['meta_query'][] = array(
399
+ 'key' => 'wp_review_type',
400
+ 'compare' => '=',
401
+ 'value' => $review_type
402
+ );
403
+ } else {
404
+ $custom_query['meta_query'][] = array(
405
+ 'key' => 'wp_review_type',
406
+ 'compare' => '!=',
407
+ 'value' => ''
408
+ );
409
+ }
410
+ break;
411
+ }
412
+
413
+ ?>
414
+ <ul>
415
+ <?php
416
+ $review_query = new WP_Query($custom_query);
417
+ $last_page = $review_query->max_num_pages;
418
+ while ($review_query->have_posts()) : $review_query->the_post(); ?>
419
+ <li>
420
+ <a title="<?php the_title(); ?>" rel="nofollow" href="<?php the_permalink() ?>">
421
+ <div class="wp_review_tab_thumbnail wp_review_tab_thumb_<?php echo $thumb_size; ?>">
422
+ <?php if(has_post_thumbnail()): ?>
423
+ <?php the_post_thumbnail('wp_review_'.$thumb_size, array('title' => '')); ?>
424
+ <?php else: ?>
425
+ <img src="<?php echo WP_REVIEW_ASSETS.'images/'.$thumb_size.'thumb.png'; ?>" alt="<?php the_title(); ?>" class="wp-post-image" />
426
+ <?php endif; ?>
427
+ </div>
428
+ </a>
429
+ <div class="title-right">
430
+ <div class="entry-title"><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php echo get_the_title(); ?></div></a>
431
+ <?php wp_review_show_total(true, 'review-total-only '.$thumb_size.'-thumb'); ?>
432
+ <?php if ( $show_date ) : ?>
433
+ <div class="wp-review-tab-postmeta">
434
+ <?php the_time('M j, Y'); ?>
435
+ </div> <!--end .entry-meta-->
436
+ <?php endif; ?>
437
+ </div>
438
+ <div class="clear"></div>
439
+ </li>
440
+ <?php $post_num++; endwhile; wp_reset_query(); ?>
441
+ </ul>
442
+ <div class="clear"></div>
443
+ <?php if ($allow_pagination) : ?>
444
+ <?php $this->tab_pagination($page, $last_page); ?>
445
+ <?php endif; ?>
446
+ <?php
447
+ die(); // required to return a proper result
448
+ }
449
+ function tab_pagination($page, $last_page) {
450
+ ?>
451
+ <div class="wp-review-tab-pagination">
452
+ <?php if ($page > 1) : ?>
453
+ <a href="#" class="previous"><span><?php _e('&laquo; Previous', 'mts-review'); ?></span></a>
454
+ <?php endif; ?>
455
+ <?php if ($page != $last_page) : ?>
456
+ <a href="#" class="next"><span><?php _e('Next &raquo;', 'mts-review'); ?></span></a>
457
+ <?php endif; ?>
458
+ </div>
459
+ <div class="clear"></div>
460
+ <input type="hidden" class="page_num" name="page_num" value="<?php echo $page; ?>" />
461
+ <?php
462
+ }
463
+ function truncate($str, $length = 24) {
464
+ if (mb_strlen($str) > $length) {
465
+ return mb_substr($str, 0, $length).'...';
466
+ } else {
467
+ return $str;
468
+ }
469
+ }
470
+ }
471
+ add_action( 'widgets_init', create_function( '', 'register_widget( "wp_review_tab_widget" );' ) );
472
+ ?>
languages/default.mo CHANGED
Binary file
languages/default.po CHANGED
@@ -1,93 +1,230 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WP Review Plugin\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-01-01 02:07+0530\n"
6
- "PO-Revision-Date: 2014-01-01 02:07+0530\n"
7
- "Last-Translator: MyThemeShop <support-team@mythemeshop.com>\n"
8
- "Language-Team: MyThemeShop\n"
9
- "Language: en_US\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: .\n"
15
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
- "X-Generator: Poedit 1.6.2\n"
17
- "X-Poedit-SearchPath-0: .\n"
18
-
19
- #: admin/metaboxes.php:26
20
- msgid "Review"
21
- msgstr ""
22
-
23
- #: admin/metaboxes.php:35
24
- msgid "Review Item"
25
- msgstr ""
26
-
27
- #: admin/metaboxes.php:44
28
- msgid "Review Description"
29
- msgstr ""
30
-
31
- #: admin/metaboxes.php:69
32
- msgid "Review Type"
33
- msgstr ""
34
-
35
- #: admin/metaboxes.php:71
36
- msgid "No Review"
37
- msgstr ""
38
-
39
- #: admin/metaboxes.php:72
40
- msgid "Star"
41
- msgstr ""
42
-
43
- #: admin/metaboxes.php:73
44
- msgid "Point"
45
- msgstr ""
46
-
47
- #: admin/metaboxes.php:74
48
- msgid "Percentage"
49
- msgstr ""
50
-
51
- #: admin/metaboxes.php:99
52
- msgid "Review Location"
53
- msgstr ""
54
-
55
- #: admin/metaboxes.php:101
56
- msgid "After Content"
57
- msgstr ""
58
-
59
- #: admin/metaboxes.php:102
60
- msgid "Before Content"
61
- msgstr ""
62
-
63
- #: admin/metaboxes.php:107
64
- msgid "Review Color"
65
- msgstr ""
66
-
67
- #: admin/metaboxes.php:116
68
- msgid "Feature Name"
69
- msgstr ""
70
-
71
- #: admin/metaboxes.php:117
72
- msgid "Star (1-5)"
73
- msgstr ""
74
-
75
- #: admin/metaboxes.php:134 admin/metaboxes.php:144 admin/metaboxes.php:153
76
- msgid "Delete"
77
- msgstr ""
78
-
79
- #: admin/metaboxes.php:162
80
- msgid "Add another"
81
- msgstr ""
82
-
83
- #: admin/metaboxes.php:166
84
- msgid "Total"
85
- msgstr ""
86
-
87
- #: includes/functions.php:52
88
- msgid "Review Overview"
89
- msgstr ""
90
-
91
- #: includes/functions.php:117
92
- msgid "Summary"
93
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Review Plugin\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-03-22 09:23+0100\n"
6
+ "PO-Revision-Date: 2014-03-23 00:57+0530\n"
7
+ "Last-Translator: MyThemeShop <support-team@mythemeshop.com>\n"
8
+ "Language-Team: MyThemeShop\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Language: en_US\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
+ "X-Generator: Poedit 1.6.2\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #: ../admin/metaboxes.php:30
20
+ msgid "Review"
21
+ msgstr ""
22
+
23
+ #: ../admin/metaboxes.php:39
24
+ msgid "Review Item"
25
+ msgstr ""
26
+
27
+ #: ../admin/metaboxes.php:48 ../admin/metaboxes.php:274
28
+ msgid "Review Heading"
29
+ msgstr ""
30
+
31
+ #: ../admin/metaboxes.php:57
32
+ msgid "Review Description"
33
+ msgstr ""
34
+
35
+ #: ../admin/metaboxes.php:66
36
+ msgid "User Reviews"
37
+ msgstr ""
38
+
39
+ #: ../admin/metaboxes.php:90 ../includes/widget.php:76
40
+ msgid "Star"
41
+ msgstr ""
42
+
43
+ #: ../admin/metaboxes.php:90 ../includes/widget.php:77
44
+ msgid "Point"
45
+ msgstr ""
46
+
47
+ #: ../admin/metaboxes.php:90 ../includes/widget.php:78
48
+ msgid "Percentage"
49
+ msgstr ""
50
+
51
+ #: ../admin/metaboxes.php:94
52
+ msgid "Review Type"
53
+ msgstr ""
54
+
55
+ #: ../admin/metaboxes.php:96
56
+ msgid "No Review"
57
+ msgstr ""
58
+
59
+ #: ../admin/metaboxes.php:160
60
+ msgid "Review Location"
61
+ msgstr ""
62
+
63
+ #: ../admin/metaboxes.php:162
64
+ msgid "After Content"
65
+ msgstr ""
66
+
67
+ #: ../admin/metaboxes.php:163
68
+ msgid "Before Content"
69
+ msgstr ""
70
+
71
+ #: ../admin/metaboxes.php:164
72
+ msgid "Custom (use shortcode)"
73
+ msgstr ""
74
+
75
+ #: ../admin/metaboxes.php:171
76
+ msgid "Copy &amp; paste this shortcode in the content."
77
+ msgstr ""
78
+
79
+ #: ../admin/metaboxes.php:175
80
+ msgid "Review Color"
81
+ msgstr ""
82
+
83
+ #: ../admin/metaboxes.php:180
84
+ msgid "Font Color"
85
+ msgstr ""
86
+
87
+ #: ../admin/metaboxes.php:185
88
+ msgid "Heading Background Color"
89
+ msgstr ""
90
+
91
+ #: ../admin/metaboxes.php:190
92
+ msgid "Background Color"
93
+ msgstr ""
94
+
95
+ #: ../admin/metaboxes.php:195
96
+ msgid "Border Color"
97
+ msgstr ""
98
+
99
+ #: ../admin/metaboxes.php:204
100
+ msgid "Feature Name"
101
+ msgstr ""
102
+
103
+ #: ../admin/metaboxes.php:205
104
+ msgid "Star (1-5)"
105
+ msgstr ""
106
+
107
+ #: ../admin/metaboxes.php:222 ../admin/metaboxes.php:232
108
+ #: ../admin/metaboxes.php:241
109
+ msgid "Delete"
110
+ msgstr ""
111
+
112
+ #: ../admin/metaboxes.php:250
113
+ msgid "Add another"
114
+ msgstr ""
115
+
116
+ #: ../admin/metaboxes.php:254
117
+ msgid "Total"
118
+ msgstr ""
119
+
120
+ #: ../admin/metaboxes.php:313
121
+ msgid "Disabled"
122
+ msgstr ""
123
+
124
+ #: ../admin/metaboxes.php:317
125
+ msgid "Enabled"
126
+ msgstr ""
127
+
128
+ #: ../includes/functions.php:144
129
+ msgid "Summary"
130
+ msgstr ""
131
+
132
+ #: ../includes/functions.php:226
133
+ msgid "User Rating"
134
+ msgstr ""
135
+
136
+ #: ../includes/functions.php:227
137
+ msgid "votes"
138
+ msgstr ""
139
+
140
+ #: ../includes/functions.php:234
141
+ msgid "Sending"
142
+ msgstr ""
143
+
144
+ #: ../includes/widget.php:13
145
+ msgid "Display Reviews in tabbed format."
146
+ msgstr ""
147
+
148
+ #: ../includes/widget.php:15
149
+ msgid "WP Review Widget"
150
+ msgstr ""
151
+
152
+ #: ../includes/widget.php:36 ../includes/widget.php:53
153
+ #: ../includes/widget.php:128 ../includes/widget.php:148
154
+ msgid "Top Rated"
155
+ msgstr ""
156
+
157
+ #: ../includes/widget.php:36 ../includes/widget.php:57
158
+ #: ../includes/widget.php:132 ../includes/widget.php:152
159
+ msgid "Recent"
160
+ msgstr ""
161
+
162
+ #: ../includes/widget.php:36 ../includes/widget.php:61
163
+ #: ../includes/widget.php:136 ../includes/widget.php:156
164
+ msgid "Most Voted"
165
+ msgstr ""
166
+
167
+ #: ../includes/widget.php:36
168
+ msgid "Editor's choice"
169
+ msgstr ""
170
+
171
+ #: ../includes/widget.php:48
172
+ msgid "Select Tabs"
173
+ msgstr ""
174
+
175
+ #: ../includes/widget.php:65 ../includes/widget.php:140
176
+ #: ../includes/widget.php:160
177
+ msgid "Custom"
178
+ msgstr ""
179
+
180
+ #: ../includes/widget.php:73
181
+ msgid "Review type:"
182
+ msgstr ""
183
+
184
+ #: ../includes/widget.php:75
185
+ msgid "Any"
186
+ msgstr ""
187
+
188
+ #: ../includes/widget.php:85
189
+ msgid "Allow pagination"
190
+ msgstr ""
191
+
192
+ #: ../includes/widget.php:90
193
+ msgid "Number of reviews to show:"
194
+ msgstr ""
195
+
196
+ #: ../includes/widget.php:97
197
+ msgid "Thumbnail size:"
198
+ msgstr ""
199
+
200
+ #: ../includes/widget.php:99
201
+ msgid "Small"
202
+ msgstr ""
203
+
204
+ #: ../includes/widget.php:100
205
+ msgid "Large"
206
+ msgstr ""
207
+
208
+ #: ../includes/widget.php:107
209
+ msgid "Show date"
210
+ msgstr ""
211
+
212
+ #: ../includes/widget.php:112
213
+ msgid "Reviews on Custom tab:"
214
+ msgstr ""
215
+
216
+ #: ../includes/widget.php:122
217
+ msgid "Tab Titles"
218
+ msgstr ""
219
+
220
+ #: ../includes/widget.php:122
221
+ msgid "Tab Order"
222
+ msgstr ""
223
+
224
+ #: ../includes/widget.php:452
225
+ msgid "&laquo; Previous"
226
+ msgstr ""
227
+
228
+ #: ../includes/widget.php:455
229
+ msgid "Next &raquo;"
230
+ msgstr ""
license.txt CHANGED
File without changes
readme.txt CHANGED
@@ -1,93 +1,108 @@
1
- === WP Review ===
2
- Contributors: mythemeshop
3
- Creator's website link: http://mythemeshop.com/
4
- Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
- Requires at least: 3.0.1
6
- Tested up to: 3.9
7
- Stable tag: 2.0
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
12
-
13
- == Description ==
14
-
15
- Did you always want to increase the user interaction on your website by rating products/services/anything? We at <a href="http://mythemeshop.com/">MyThemeShop</a> understand your need, & created a premium Review plugin. We are now distributing it for FREE to give back to the WordPress community. We have been given so much by the WordPress community, it's time to give back.
16
-
17
- **WP Review plugin** is an easy yet powerful way to review content easily, without affecting the speed of your site. If you're a blogger, you probably occasionally review or rank products, services, tools, recipes, or other content on your site. WP Review plugin is a customizable and lightweight way to create reviews, using stars, percentage or point rating, and it includes support for translation, WPMU, Google rich snippets and unlimited colors. Just install it and follow the simple configuration instructions to place it in your desired location.
18
-
19
- = Live Demos =
20
- See WP Review in action on our demo pages:
21
- * <a href="http://demo.mythemeshop.com/spike-gaming/2014/03/12/the-12-most-inspirational-female-characters-in-games/" target="_blank">Star Review Type</a>
22
- * <a href="http://demo.mythemeshop.com/spike-wedding/2014/03/13/top-10-wedding-guest-complaints/" target="_blank">Point Review Type</a>
23
- * <a href="http://demo.mythemeshop.com/spike-health/2014/02/27/high-calorie-foods-you-should-never-eat-before-going-to-bed/" target="_blank">Percentage Review Type</a>
24
-
25
- = Why WP Review from <a href="http://mythemeshop.com">MyThemeShop</a>: =
26
- * Fastest review plugin.
27
- * Stars, percentage and point rating system.
28
- * Supports Google Rich Snippets(schema.org)
29
- * 100% Fluid Responsive.
30
- * WP Multisite and Multiuser (WPMU / WPMS / WordPress MU) compatible.
31
- * Design it as you want, unlimited color options.
32
- * Translation Ready.
33
- * Reviews are displayed to visitors in a friendly format.
34
- * Completely customizable, including which fields to ask for, require, and show.
35
- * Minimal design but could be instantly made modern.
36
- * Works with caching plugins and all majority of themes.
37
- * Easy to modify the CSS to better fit your theme style.
38
- * Support for adding your own custom fields.
39
- * Minimalist, lightweight, and efficient code means that your users won’t notice any hiccups.
40
- * Position it above or below the content with ease and no coding.
41
- * Supports Shortcode `[wp-review]` to show review anywhere in post.
42
-
43
- = Support =
44
- We will do our best to provide support through the WordPress forums. However, all plugin support is provided in our forum. If you have not registered yet, you can do so here: <a href="https://mythemeshop.com/go/signup/index/c/free">https://mythemeshop.com/go/signup/index/c/free</a>. After searching the knowledge base and forum if you are still stuck, feel free to open a new thread, and a member of our support team will be happy to help. Cheers!<br>
45
- Support link: <a href="http://community.mythemeshop.com/forum/free/plugin-support">http://community.mythemeshop.com/forum/free/plugin-support</a>
46
-
47
- = Developer Zone =
48
- Yes, this plugin is so developer friendly, so you could use it with any theme you develop. Define default CSS, custom position, one line integration in your theme's code.
49
-
50
- Show average review in your theme using below function:
51
- `<?php if (function_exists('wp_review_show_total')) wp_review_show_total(); ?>`
52
-
53
- GitHub link: <a href="https://github.com/MyThemeShop/WP-Review-by-MyThemeShop">https://github.com/MyThemeShop/WP-Review-by-MyThemeShop</a>
54
-
55
- = Feedback =
56
- If you like this plugin, then please leave us a good rating and review.<br> Consider following us on <a rel="author" href="https://plus.google.com/+Mythemeshop/">Google+</a>, <a href="https://twitter.com/MyThemeShopTeam">Twitter</a>, and <a href="https://www.facebook.com/MyThemeShop">Facebook</a>
57
-
58
- == Installation ==
59
-
60
- This section describes how to install the plugin and get it working.
61
-
62
- 1. Upload the `wp-review` folder to the to the `/wp-content/plugins/` directory
63
- 2. Activate the plugin through the 'Plugins' menu in WordPress
64
- 3. You can see rating options on single post editor.
65
- 4. Configure the available rating options as you want.
66
-
67
- == Frequently Asked Questions ==
68
-
69
- = User rating not working =
70
-
71
- Please disable all plugins and check if rating is working properly. Then you can enable all plugins one by one to find out which plugin is conflicting with WP Rating plugin.
72
-
73
- == Screenshots ==
74
-
75
- 1. Plugin Options
76
- 2. Plugin Options 2
77
- 3. Star Review type
78
- 4. Point Review type
79
- 5. Percentage Review type
80
-
81
- == Changelog ==
82
-
83
- = 2.0 =
84
- * Fixed the, `'` switching in to `/` issue (<a href="http://bit.ly/PFMGAq">http://bit.ly/PFMGAq</a>)
85
- * Added `[wp-review]` shortcode to show the ratings anywhere in the content.
86
- * Added an option to not show review automatically in the Review Location dropdown.
87
- * Added support for Custom post types and pages.
88
- * For Developers Added new function for showing only total rating, it could be used in themes' archives. A custom class name can be passed to the function, for easier customization. See `wp_review_show_total()` function in includes/functions.php file. There's also a shortcode for it, just in case: [wp-review-total]
89
- * For Developers Added the default colors which appear in the meta boxes are now stored in an option. It can be modified directly with `update_option()`, or using the new `wp_review_set_default_colors()` function, which is also called on plugin activation to set the plugin's default colors.
90
- * Made small CSS and responsive improvements.
91
-
92
- = 1.0 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  * Official plugin release.
1
+ === WP Review ===
2
+ Contributors: mythemeshop
3
+ Creator's website link: http://mythemeshop.com/
4
+ Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
+ Requires at least: 3.0.1
6
+ Tested up to: 3.9
7
+ Stable tag: 3.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
12
+
13
+ == Description ==
14
+
15
+ Did you always want to increase the user interaction on your website by rating products/services/anything? We at <a href="http://mythemeshop.com/">MyThemeShop</a> understand your need, & created a premium Review plugin. We are now distributing it for FREE to give back to the WordPress community. We have been given so much by the WordPress community, it's time to give back.
16
+
17
+ **WP Review plugin** is an easy yet powerful way to review content easily, without affecting the speed of your site. If you're a blogger, you probably occasionally review or rank products, services, tools, recipes, or other content on your site. WP Review plugin is a customizable and lightweight way to create reviews, using stars, percentage or point rating, and it includes support for translation, WPMU, Google rich snippets and unlimited colors. Just install it and follow the simple configuration instructions to place it in your desired location.
18
+
19
+ = Live Demos =
20
+ See WP Review in action on our demo pages:
21
+ * <a href="http://demo.mythemeshop.com/spike-gaming/the-12-most-inspirational-female-characters-in-games/" target="_blank">Star Review Type</a>
22
+ * <a href="http://demo.mythemeshop.com/spike-wedding/2014/03/13/top-10-wedding-guest-complaints/" target="_blank">Point Review Type</a>
23
+ * <a href="http://demo.mythemeshop.com/spike-health/2014/02/27/high-calorie-foods-you-should-never-eat-before-going-to-bed/" target="_blank">Percentage Review Type</a>
24
+
25
+ = Why WP Review from <a href="http://mythemeshop.com">MyThemeShop</a>: =
26
+ * Fastest review plugin.
27
+ * Stars, percentage and point rating system.
28
+ * Supports Google Rich Snippets(schema.org)
29
+ * 100% Fluid Responsive.
30
+ * Included tabbed widget to show recent reviews and popular reviews.
31
+ * WP Multisite and Multiuser (WPMU / WPMS / WordPress MU) compatible.
32
+ * Design it as you want, unlimited color options.
33
+ * Translation Ready.
34
+ * Reviews are displayed to visitors in a friendly format.
35
+ * Completely customizable, including which fields to ask for, require, and show.
36
+ * Minimal design but could be instantly made modern.
37
+ * Works with caching plugins and all majority of themes.
38
+ * Easy to modify the CSS to better fit your theme style.
39
+ * Support for adding your own custom fields.
40
+ * Minimalist, lightweight, and efficient code means that your users won’t notice any hiccups.
41
+ * Position it above or below the content with ease and no coding.
42
+ * Supports Shortcode `[wp-review]` to show review anywhere in post.
43
+ * Developer friendly.
44
+
45
+ = Support =
46
+ We will do our best to provide support through the WordPress forums. However, all plugin support is provided in our forum. If you have not registered yet, you can do so here: <a href="https://mythemeshop.com/go/signup/index/c/free">https://mythemeshop.com/go/signup/index/c/free</a>. After searching the knowledge base and forum if you are still stuck, feel free to open a new thread, and a member of our support team will be happy to help. Cheers!<br>
47
+ Support link: <a href="http://community.mythemeshop.com/forum/free/plugin-support">http://community.mythemeshop.com/forum/free/plugin-support</a>
48
+
49
+ = Developer Zone =
50
+ Yes, this plugin is so developer friendly, so you could use it with any theme you develop. Define default CSS, custom position, one line integration in your theme's code.
51
+
52
+ Show average review in your theme using below function:
53
+ `<?php if (function_exists('wp_review_show_total')) wp_review_show_total(); ?>`
54
+
55
+ You can find full list of the available filters here <a href="https://github.com/MyThemeShop/WP-Review-by-MyThemeShop/blob/master/filter-list.php" target="_blank">https://github.com/MyThemeShop/WP-Review-by-MyThemeShop/blob/master/filter-list.php</a>, a theme developer can decide to set fixed colors for the reviews, and hide selected (or all) color fields in the metabox, to keep it simple for the end user.
56
+
57
+ GitHub link: <a href="https://github.com/MyThemeShop/WP-Review-by-MyThemeShop">https://github.com/MyThemeShop/WP-Review-by-MyThemeShop</a>
58
+
59
+ = Feedback =
60
+ If you like this plugin, then please leave us a good rating and review.<br> Consider following us on <a rel="author" href="https://plus.google.com/+Mythemeshop/">Google+</a>, <a href="https://twitter.com/MyThemeShopTeam">Twitter</a>, and <a href="https://www.facebook.com/MyThemeShop">Facebook</a>
61
+
62
+ == Installation ==
63
+
64
+ This section describes how to install the plugin and get it working.
65
+
66
+ 1. Upload the `wp-review` folder to the to the `/wp-content/plugins/` directory
67
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
68
+ 3. You can see rating options on single post editor.
69
+ 4. Configure the available rating options as you want.
70
+
71
+ == Frequently Asked Questions ==
72
+
73
+ = User rating not working =
74
+
75
+ Please disable all plugins and check if rating is working properly. Then you can enable all plugins one by one to find out which plugin is conflicting with WP Rating plugin.
76
+
77
+ == Screenshots ==
78
+
79
+ 1. Plugin Options
80
+ 2. Plugin Options 2
81
+ 3. Review Widget
82
+ 4. Star Review type
83
+ 5. Point Review type
84
+ 6. Percentage Review type
85
+
86
+ == Changelog ==
87
+
88
+ = 3.0 =
89
+ * Major security updates
90
+ * New AJAXified Tab widget for Popular and Recent reviews, try it, you gonna love it.
91
+ * Language file updated fully.
92
+ * Added a nonce (a security token) to ensure that the user actually voted from the review
93
+ * More developer possibilities
94
+ * Added filters for developers. Using a filter is much better than a function for setting the default colors.
95
+ * Compatible with WordPress 3.9 Beta
96
+ * Plugin will support the widget customizer coming up in WordPress 3.9
97
+
98
+ = 2.0 =
99
+ * Fixed the, `'` switching in to `/` issue (<a href="http://bit.ly/PFMGAq">http://bit.ly/PFMGAq</a>)
100
+ * Added `[wp-review]` shortcode to show the ratings anywhere in the content.
101
+ * Added an option to not show review automatically in the Review Location dropdown.
102
+ * Added support for Custom post types and pages.
103
+ * For Developers Added new function for showing only total rating, it could be used in themes' archives. A custom class name can be passed to the function, for easier customization. See `wp_review_show_total()` function in includes/functions.php file. There's also a shortcode for it, just in case: [wp-review-total]
104
+ * For Developers Added the default colors which appear in the meta boxes are now stored in an option. It can be modified directly with `update_option()`, or using the new `wp_review_set_default_colors()` function, which is also called on plugin activation to set the plugin's default colors.
105
+ * Made small CSS and responsive improvements.
106
+
107
+ = 1.0 =
108
  * Official plugin release.
wp-review.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Plugin Name: WP Review
4
  * Plugin URI: http://mythemeshop.com/
5
- * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
6
- * Version: 2.0
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
@@ -88,6 +88,9 @@ function wp_review_includes_libraries() {
88
  /* Loads the front-end functions. */
89
  require_once( WP_REVIEW_INCLUDES . 'functions.php' );
90
 
 
 
 
91
  /* Loads the enqueue functions. */
92
  require_once( WP_REVIEW_INCLUDES . 'enqueue.php' );
93
 
@@ -95,7 +98,7 @@ function wp_review_includes_libraries() {
95
 
96
  function wp_review_activation(){
97
  /* Loads activation functions */
98
- require_once( plugin_dir_path( __FILE__ ) . '/includes/functions.php' );
99
  require_once( plugin_dir_path( __FILE__ ) . '/admin/activation.php' );
100
  }
101
  ?>
2
  /**
3
  * Plugin Name: WP Review
4
  * Plugin URI: http://mythemeshop.com/
5
+ * Description: Easily create custom review content.
6
+ * Version: 3.0
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
88
  /* Loads the front-end functions. */
89
  require_once( WP_REVIEW_INCLUDES . 'functions.php' );
90
 
91
+ /* Loads the widget. */
92
+ require_once( WP_REVIEW_INCLUDES . 'widget.php' );
93
+
94
  /* Loads the enqueue functions. */
95
  require_once( WP_REVIEW_INCLUDES . 'enqueue.php' );
96
 
98
 
99
  function wp_review_activation(){
100
  /* Loads activation functions */
101
+ //require_once( plugin_dir_path( __FILE__ ) . '/includes/functions.php' );
102
  require_once( plugin_dir_path( __FILE__ ) . '/admin/activation.php' );
103
  }
104
  ?>