WP Review - Version 3.2

Version Description

  • Added Options Panel for Global Option
  • Added option to set Global Colors.
  • Added option to Global position.
  • Added option to add Global Features.
  • Added option to change review description title (Summary).
  • Added option to hide Description and Total Rating.
  • Added option to add your own Total Score.
  • Fixed schema tag issue in wp_review_show_total()
  • Fixed jQuery issue.
  • Fixed post preview issue.
  • Fixed conflict with Redux Framework, Visual Composer and Mailpoet.
  • Added New Filters.
  • Updated No Preview thumbnail.
  • Merged Star and Loader icon files in one.
  • Fixed many small bugs.
  • Optimized code for better performance.
Download this release

Release Info

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

Code changes from version 3.1 to 3.2

admin/activation.php CHANGED
@@ -6,8 +6,8 @@ function mts_create_review_tables(){
6
  if (function_exists('is_multisite') && is_multisite()) $table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;
7
 
8
  /*$sql = "DROP TABLE IF_EXISTS $table_name;";
9
- $e = $wpdb->query($sql);
10
- die(var_dump($e));*/
11
  $my_stat_sql = "CREATE TABLE IF NOT EXISTS $table_name (
12
  id int(11) NOT NULL auto_increment,
13
  blog_id int(11) NOT NULL,
6
  if (function_exists('is_multisite') && is_multisite()) $table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;
7
 
8
  /*$sql = "DROP TABLE IF_EXISTS $table_name;";
9
+ $e = $wpdb->query($sql);
10
+ die(var_dump($e));*/
11
  $my_stat_sql = "CREATE TABLE IF NOT EXISTS $table_name (
12
  id int(11) NOT NULL auto_increment,
13
  blog_id int(11) NOT NULL,
admin/admin.php CHANGED
@@ -22,5 +22,12 @@ function wp_review_admin_style( $hook_suffix ) {
22
 
23
  /* Load the color picker dependencies style. */
24
  wp_enqueue_style( 'wp-color-picker' );
 
 
 
 
 
 
 
25
  }
26
  ?>
22
 
23
  /* Load the color picker dependencies style. */
24
  wp_enqueue_style( 'wp-color-picker' );
25
+
26
+ wp_enqueue_style('plugin_name-admin-ui-css',
27
+ 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css',
28
+ false,
29
+ null,
30
+ false);
31
+
32
  }
33
  ?>
admin/metaboxes.php CHANGED
@@ -110,6 +110,7 @@ function wp_review_render_meta_box_review_options( $post ) {
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',
@@ -121,15 +122,18 @@ function wp_review_render_meta_box_item( $post ) {
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
 
132
  /* Retrieve an existing value from the database. */
 
 
 
133
  $items = get_post_meta( $post->ID, 'wp_review_item', true );
134
  $color = get_post_meta( $post->ID, 'wp_review_color', true );
135
  $location = get_post_meta( $post->ID, 'wp_review_location', true );
@@ -138,64 +142,26 @@ function wp_review_render_meta_box_item( $post ) {
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>
163
- <option value="top" <?php selected( $location, 'top' ); ?>><?php _e( 'Before Content', 'wp-review' ) ?></option>
164
- <option value="custom" <?php selected( $location, 'custom' ); ?>><?php _e( 'Custom (use shortcode)', 'wp-review' ) ?></option>
165
- </select>
166
- </p>
167
-
168
- <p class="wp-review-field" id="wp_review_shortcode_hint_field">
169
- <label for="wp_review_shortcode_hint"></label>
170
- <input id="wp_review_shortcode_hint" type="text" value="[wp-review]" readonly="readonly" />
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>
198
-
199
  <!-- Start repeater field -->
200
  <table id="wp-review-item" class="wp-review-item" width="100%">
201
 
@@ -249,12 +215,65 @@ function wp_review_render_meta_box_item( $post ) {
249
  <tr>
250
  <td width="80%"><a id="add-row" class="button" href="#"><?php _e( 'Add another', 'wp-review' ) ?></a></td>
251
  <td width="10%">
252
- <input type="text" class="widefat wp-review-total" name="wp_review_total" value="<?php echo get_post_meta( $post->ID, 'wp_review_total', true ); ?>" readonly="readonly" />
253
  </td>
254
  <td width="10%"><?php _e( 'Total', 'wp-review' ); ?></td>
255
  </tr>
256
  </table>
257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  <?php
259
  }
260
 
@@ -282,8 +301,16 @@ function wp_review_render_meta_box_desc( $post ) {
282
  /* Add an nonce field so we can check for it later. */
283
  wp_nonce_field( basename( __FILE__ ), 'wp-review-desc-nonce' );
284
 
285
- /* Retrieve an existing value from the database. */
 
286
  $desc = get_post_meta( $post->ID, 'wp_review_desc', true );
 
 
 
 
 
 
 
287
 
288
  /* Display wp editor field. */
289
  wp_editor(
@@ -296,7 +323,15 @@ function wp_review_render_meta_box_desc( $post ) {
296
  'textarea_rows' => 10
297
  )
298
  );
299
-
 
 
 
 
 
 
 
 
300
  }
301
 
302
  function wp_review_render_meta_box_userReview( $post ) {
@@ -307,17 +342,17 @@ function wp_review_render_meta_box_userReview( $post ) {
307
  $userReviews = get_post_meta( $post->ID, 'wp_review_userReview', true );
308
  $enabled = false;
309
  if( is_array( $userReviews ) && $userReviews[0] == 1 ) $enabled = true;
 
310
  ?>
311
 
312
  <p class="wp-review-field">
313
  <label for="wp-review-userReview-disable"> <?php _e( 'Disabled', 'wp-review' ); ?>
314
- <input type="radio" name="wp_review_userReview[]" id="wp-review-userReview-disable" value="0" <?php echo !$enabled ? 'checked' : ''; ?> />
315
  </label>
316
 
317
  <label for="wp-review-userReview-enable"> <?php _e( 'Enabled', 'wp-review' ); ?>
318
- <input type="radio" name="wp_review_userReview[]" id="wp-review-userReview-enable" value="1" <?php echo $enabled ? 'checked' : ''; ?> />
319
  </label>
320
-
321
  </p>
322
 
323
  <?php
@@ -359,17 +394,22 @@ function wp_review_save_postdata( $post_id, $post ) {
359
  }
360
 
361
  $meta = array(
 
 
 
362
  'wp_review_location' => $_POST['wp_review_location'],
363
  'wp_review_type' => $_POST['wp_review_type'],
364
  'wp_review_heading' => $_POST['wp_review_heading'],
 
365
  'wp_review_desc' => $_POST['wp_review_desc'],
 
366
  'wp_review_userReview' => $_POST['wp_review_userReview'],
367
  'wp_review_total' => $_POST['wp_review_total'],
368
  'wp_review_color' => $_POST['wp_review_color'],
369
  'wp_review_fontcolor' => $_POST['wp_review_fontcolor'],
370
  'wp_review_bgcolor1' => $_POST['wp_review_bgcolor1'],
371
  'wp_review_bgcolor2' => $_POST['wp_review_bgcolor2'],
372
- 'wp_review_bordercolor' => $_POST['wp_review_bordercolor']
373
  );
374
 
375
  foreach ( $meta as $meta_key => $new_meta_value ) {
@@ -378,15 +418,15 @@ function wp_review_save_postdata( $post_id, $post ) {
378
  $meta_value = get_post_meta( $post_id, $meta_key, true );
379
 
380
  /* If there is no new meta value but an old value exists, delete it. */
381
- if ( current_user_can( 'delete_post_meta', $post_id, $meta_key ) && '' == $new_meta_value && $meta_value )
382
  delete_post_meta( $post_id, $meta_key, $meta_value );
383
 
384
  /* If a new meta value was added and there was no previous value, add it. */
385
- elseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && $new_meta_value && '' == $meta_value )
386
  add_post_meta( $post_id, $meta_key, $new_meta_value, true );
387
 
388
  /* If the new meta value does not match the old value, update it. */
389
- elseif ( current_user_can( 'edit_post_meta', $post_id, $meta_key ) && $new_meta_value && $new_meta_value != $meta_value )
390
  update_post_meta( $post_id, $meta_key, $new_meta_value );
391
  }
392
 
@@ -414,7 +454,7 @@ function wp_review_save_postdata( $post_id, $post ) {
414
  /**
415
  * Delete all data when switched to 'No Review' type.
416
  */
417
- $type = get_post_meta( $post_id, 'wp_review_type', true );
418
  if ( $type == '' ) {
419
  delete_post_meta( $post_id, 'wp_review_desc', $_POST['wp_review_desc'] );
420
  delete_post_meta( $post_id, 'wp_review_heading', $_POST['wp_review_heading'] );
@@ -423,4 +463,16 @@ function wp_review_save_postdata( $post_id, $post ) {
423
  }
424
 
425
  }
 
 
 
 
 
 
 
 
 
 
 
 
426
  ?>
110
  * @since 1.0
111
  */
112
  function wp_review_render_meta_box_item( $post ) {
113
+ $options = get_option('wp_review_options');
114
  $defaultColors = apply_filters('wp_review_default_colors', array(
115
  'color' => '#1e73be',
116
  'fontcolor' => '#555555',
122
 
123
  $defaultCriteria = apply_filters('wp_review_default_criteria', array());
124
  $defaultItems = array();
125
+ if (empty($defaultCriteria) && ! empty($options['default_features'])) $defaultCriteria = $options['default_features'];
126
  foreach ($defaultCriteria as $item) {
127
  $defaultItems[] = array( 'wp_review_item_title' => $item, 'wp_review_item_star' => '');
128
  }
129
 
 
130
  /* Add an nonce field so we can check for it later. */
131
  wp_nonce_field( basename( __FILE__ ), 'wp-review-item-nonce' );
132
 
133
  /* Retrieve an existing value from the database. */
134
+ $custom_colors = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
135
+ $custom_location = get_post_meta( $post->ID, 'wp_review_custom_location', true );
136
+
137
  $items = get_post_meta( $post->ID, 'wp_review_item', true );
138
  $color = get_post_meta( $post->ID, 'wp_review_color', true );
139
  $location = get_post_meta( $post->ID, 'wp_review_location', true );
142
  $bgcolor2 = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
143
  $bordercolor = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
144
  if ( $items == '' ) $items = $defaultItems;
145
+ if( $color == '' ) $color = ( ! empty($options['colors']['color'] ) ? $options['colors']['color'] : $defaultColors['color']);
146
+ if( $location == '' ) $location = ( ! empty($options['location'] ) ? $options['location'] : $defaultLocation);
147
+ if( $fontcolor == '' ) $fontcolor = ( ! empty($options['colors']['fontcolor'] ) ? $options['colors']['fontcolor'] : $defaultColors['fontcolor']);
148
+ if( $bgcolor1 == '' ) $bgcolor1 = ( ! empty($options['colors']['bgcolor1'] ) ? $options['colors']['bgcolor1'] : $defaultColors['bgcolor1']);
149
+ if( $bgcolor2 == '' ) $bgcolor2 = ( ! empty($options['colors']['bgcolor2'] ) ? $options['colors']['bgcolor2'] : $defaultColors['bgcolor2']);
150
+ if( $bordercolor == '' ) $bordercolor = ( ! empty($options['colors']['bordercolor'] ) ? $options['colors']['bordercolor'] : $defaultColors['bordercolor']);
151
+
152
  $fields = array(
153
  'location' => true,
154
  'color' => true,
155
  'fontcolor' => true,
156
  'bgcolor1' => true,
157
  'bgcolor2' => true,
158
+ 'bordercolor' => true,
159
+ 'custom_colors' => true,
160
+ 'custom_location' => true,
161
  );
162
  $displayed_fields = apply_filters('wp_review_metabox_item_fields', $fields);
163
  ?>
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  <!-- Start repeater field -->
166
  <table id="wp-review-item" class="wp-review-item" width="100%">
167
 
215
  <tr>
216
  <td width="80%"><a id="add-row" class="button" href="#"><?php _e( 'Add another', 'wp-review' ) ?></a></td>
217
  <td width="10%">
218
+ <input type="text" class="widefat wp-review-total" name="wp_review_total" value="<?php echo get_post_meta( $post->ID, 'wp_review_total', true ); ?>" />
219
  </td>
220
  <td width="10%"><?php _e( 'Total', 'wp-review' ); ?></td>
221
  </tr>
222
  </table>
223
 
224
+ <p class="wp-review-field">
225
+ <label for="wp_review_custom_location"><?php _e( 'Custom Location', 'wp-review' ); ?></label>
226
+ <input type="hidden" name="wp_review_custom_location" id="wp_review_custom_location_unchecked" value="" />
227
+ <input name="wp_review_custom_location" id="wp_review_custom_location" type="checkbox" value="1" <?php echo (! empty($custom_location) ? 'checked ' : ''); ?> />
228
+ </p>
229
+ <div class="wp-review-location-options"<?php if (empty($custom_location)) echo ' style="display: none;"'; ?>>
230
+ <p class="wp-review-field">
231
+ <label for="wp_review_location"><?php _e( 'Review Location', 'wp-review' ); ?></label>
232
+ <select name="wp_review_location" id="wp_review_location">
233
+ <option value="bottom" <?php selected( $location, 'bottom' ); ?>><?php _e( 'After Content', 'wp-review' ) ?></option>
234
+ <option value="top" <?php selected( $location, 'top' ); ?>><?php _e( 'Before Content', 'wp-review' ) ?></option>
235
+ <option value="custom" <?php selected( $location, 'custom' ); ?>><?php _e( 'Custom (use shortcode)', 'wp-review' ) ?></option>
236
+ </select>
237
+ </p>
238
+ <p class="wp-review-field" id="wp_review_shortcode_hint_field">
239
+ <label for="wp_review_shortcode_hint"></label>
240
+ <input id="wp_review_shortcode_hint" type="text" value="[wp-review]" readonly="readonly" />
241
+ <span><?php _e('Copy &amp; paste this shortcode in the content.', 'wp-review') ?></span>
242
+ </p>
243
+ </div>
244
+ <p class="wp-review-field">
245
+ <label for="wp_review_custom_colors"><?php _e( 'Custom Colors', 'wp-review' ); ?></label>
246
+ <input type="hidden" name="wp_review_custom_colors" id="wp_review_custom_colors_unchecked" value="" />
247
+ <input name="wp_review_custom_colors" id="wp_review_custom_colors" type="checkbox" value="1" <?php echo (! empty($custom_colors) ? 'checked ' : ''); ?>/>
248
+ </p>
249
+ <div class="wp-review-color-options"<?php if (empty($custom_colors)) echo ' style="display: none;"'; ?>>
250
+
251
+ <p class="wp-review-field"<?php if (empty($displayed_fields['color'])) echo ' style="display: none;"'; ?>>
252
+ <label for="wp_review_color"><?php _e( 'Review Color', 'wp-review' ); ?></label>
253
+ <input type="text" class="wp-review-color" name="wp_review_color" value="<?php echo $color; ?>" />
254
+ </p>
255
+
256
+ <p class="wp-review-field"<?php if (empty($displayed_fields['fontcolor'])) echo ' style="display: none;"'; ?>>
257
+ <label for="wp_review_fontcolor"><?php _e( 'Font Color', 'wp-review' ); ?></label>
258
+ <input type="text" class="wp-review-color" name="wp_review_fontcolor" id ="wp_review_fontcolor" value="<?php echo $fontcolor; ?>" />
259
+ </p>
260
+
261
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bgcolor1'])) echo ' style="display: none;"'; ?>>
262
+ <label for="wp_review_bgcolor1"><?php _e( 'Heading Background Color', 'wp-review' ); ?></label>
263
+ <input type="text" class="wp-review-color" name="wp_review_bgcolor1" id ="wp_review_bgcolor1" value="<?php echo $bgcolor1; ?>" />
264
+ </p>
265
+
266
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bgcolor2'])) echo ' style="display: none;"'; ?>>
267
+ <label for="wp_review_bgcolor2"><?php _e( 'Background Color', 'wp-review' ); ?></label>
268
+ <input type="text" class="wp-review-color" name="wp_review_bgcolor2" id="wp_review_bgcolor2" value="<?php echo $bgcolor2; ?>" />
269
+ </p>
270
+
271
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bordercolor'])) echo ' style="display: none;"'; ?>>
272
+ <label for="wp_review_bordercolor"><?php _e( 'Border Color', 'wp-review' ); ?></label>
273
+ <input type="text" class="wp-review-color" name="wp_review_bordercolor" id="wp_review_bordercolor" value="<?php echo $bordercolor; ?>" />
274
+ </p>
275
+ </div>
276
+
277
  <?php
278
  }
279
 
301
  /* Add an nonce field so we can check for it later. */
302
  wp_nonce_field( basename( __FILE__ ), 'wp-review-desc-nonce' );
303
 
304
+ /* Retrieve existing values from the database. */
305
+ $hide_desc = get_post_meta( $post->ID, 'wp_review_hide_desc', true );
306
  $desc = get_post_meta( $post->ID, 'wp_review_desc', true );
307
+ $desc_title = get_post_meta( $post->ID, 'wp_review_desc_title', true );
308
+ if (!$desc_title) $desc_title = __('Summary', 'wp-review');
309
+ ?>
310
+ <p id="wp-review-desc-title" class="wp-review-field">
311
+ <input type="text" name="wp_review_desc_title" id="wp_review_desc_title" value="<?php esc_attr_e( $desc_title ); ?>" />
312
+ </p>
313
+ <?php
314
 
315
  /* Display wp editor field. */
316
  wp_editor(
323
  'textarea_rows' => 10
324
  )
325
  );
326
+ ?>
327
+ <p class="wp-review-field">
328
+ <label style="width: 100%;">
329
+ <input type="hidden" name="wp_review_hide_desc" id="wp_review_hide_desc_unchecked" value="" />
330
+ <input type="checkbox" name="wp_review_hide_desc" id="wp_review_hide_desc" value="1" <?php checked( $hide_desc ); ?> />
331
+ <?php _e( 'Hide Description &amp; Total Rating', 'wp-review' ); ?>
332
+ </label>
333
+ </p>
334
+ <?php
335
  }
336
 
337
  function wp_review_render_meta_box_userReview( $post ) {
342
  $userReviews = get_post_meta( $post->ID, 'wp_review_userReview', true );
343
  $enabled = false;
344
  if( is_array( $userReviews ) && $userReviews[0] == 1 ) $enabled = true;
345
+
346
  ?>
347
 
348
  <p class="wp-review-field">
349
  <label for="wp-review-userReview-disable"> <?php _e( 'Disabled', 'wp-review' ); ?>
350
+ <input type="radio" name="wp_review_userReview[]" id="wp-review-userReview-disable" class="wp-review-userReview-options" value="0" <?php echo !$enabled ? 'checked' : ''; ?> />
351
  </label>
352
 
353
  <label for="wp-review-userReview-enable"> <?php _e( 'Enabled', 'wp-review' ); ?>
354
+ <input type="radio" name="wp_review_userReview[]" id="wp-review-userReview-enable" class="wp-review-userReview-options" value="1" <?php echo $enabled ? 'checked' : ''; ?> />
355
  </label>
 
356
  </p>
357
 
358
  <?php
394
  }
395
 
396
  $meta = array(
397
+ 'wp_review_custom_location' => $_POST['wp_review_custom_location'],
398
+ 'wp_review_custom_colors' => $_POST['wp_review_custom_colors'],
399
+ 'wp_review_custom_width' => $_POST['wp_review_custom_width'],
400
  'wp_review_location' => $_POST['wp_review_location'],
401
  'wp_review_type' => $_POST['wp_review_type'],
402
  'wp_review_heading' => $_POST['wp_review_heading'],
403
+ 'wp_review_desc_title' => $_POST['wp_review_desc_title'],
404
  'wp_review_desc' => $_POST['wp_review_desc'],
405
+ 'wp_review_hide_desc' => $_POST['wp_review_hide_desc'],
406
  'wp_review_userReview' => $_POST['wp_review_userReview'],
407
  'wp_review_total' => $_POST['wp_review_total'],
408
  'wp_review_color' => $_POST['wp_review_color'],
409
  'wp_review_fontcolor' => $_POST['wp_review_fontcolor'],
410
  'wp_review_bgcolor1' => $_POST['wp_review_bgcolor1'],
411
  'wp_review_bgcolor2' => $_POST['wp_review_bgcolor2'],
412
+ 'wp_review_bordercolor' => $_POST['wp_review_bordercolor'],
413
  );
414
 
415
  foreach ( $meta as $meta_key => $new_meta_value ) {
418
  $meta_value = get_post_meta( $post_id, $meta_key, true );
419
 
420
  /* If there is no new meta value but an old value exists, delete it. */
421
+ if ( current_user_can( 'delete_post_meta', $post_id, $meta_key ) && '' === $new_meta_value && $meta_value )
422
  delete_post_meta( $post_id, $meta_key, $meta_value );
423
 
424
  /* If a new meta value was added and there was no previous value, add it. */
425
+ elseif ( current_user_can( 'add_post_meta', $post_id, $meta_key ) && ($new_meta_value || $new_meta_value === '0') && '' == $meta_value )
426
  add_post_meta( $post_id, $meta_key, $new_meta_value, true );
427
 
428
  /* If the new meta value does not match the old value, update it. */
429
+ elseif ( current_user_can( 'edit_post_meta', $post_id, $meta_key ) && ($new_meta_value || $new_meta_value === '0') && $new_meta_value != $meta_value )
430
  update_post_meta( $post_id, $meta_key, $new_meta_value );
431
  }
432
 
454
  /**
455
  * Delete all data when switched to 'No Review' type.
456
  */
457
+ $type = $meta['wp_review_type'];//get_post_meta( $post_id, 'wp_review_type', true );
458
  if ( $type == '' ) {
459
  delete_post_meta( $post_id, 'wp_review_desc', $_POST['wp_review_desc'] );
460
  delete_post_meta( $post_id, 'wp_review_heading', $_POST['wp_review_heading'] );
463
  }
464
 
465
  }
466
+
467
+ // Fix for post previews
468
+ // with this code, the review meta data will actually get saved on Preview
469
+ add_filter('_wp_post_revision_fields', 'add_field_debug_preview');
470
+ function add_field_debug_preview($fields){
471
+ $fields["debug_preview"] = "debug_preview";
472
+ return $fields;
473
+ }
474
+ add_action( 'edit_form_after_title', 'add_input_debug_preview' );
475
+ function add_input_debug_preview() {
476
+ echo '<input type="hidden" name="debug_preview" value="debug_preview">';
477
+ }
478
  ?>
admin/options.php ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // create custom plugin settings menu
4
+ add_action('admin_menu', 'wpreview_create_menu');
5
+
6
+ function wpreview_create_menu() {
7
+
8
+ //create new top-level menu
9
+ $hook = add_options_page('WP Review', 'WP Review', 'administrator', __FILE__, 'wpreview_settings_page');
10
+
11
+ //call register settings function
12
+ add_action( 'admin_init', 'wpreview_register_settings' );
13
+
14
+ // body class
15
+ // create_function() requires PHP 5.2+
16
+ add_action( "load-$hook", create_function('', 'add_filter( "admin_body_class", "wpreview_admin_body_class" );') );
17
+ }
18
+ // body class
19
+ function wpreview_admin_body_class( $classes ) {
20
+ $classes .= 'wp-review-admin-options';
21
+ return $classes;
22
+ }
23
+ function wpreview_register_settings() {
24
+ //register our settings
25
+ register_setting( 'wpreview-settings-group', 'wp_review_options' );
26
+ }
27
+
28
+ function wpreview_settings_page() {
29
+ $options = get_option('wp_review_options');
30
+
31
+ $available_types = apply_filters('wp_review_metabox_types', array('star' => __('Star', 'wp-review'), 'point' => __('Point', 'wp-review'), 'percentage' => __('Percentage', 'wp-review')));
32
+ $default_options = array(
33
+ 'colors' => array(
34
+ 'color' => '',
35
+ 'fontcolor' => '',
36
+ 'bgcolor1' => '',
37
+ 'bgcolor2' => '',
38
+ 'bordercolor' => ''),
39
+ 'default_features' => array(),
40
+ 'image_sizes' => array()
41
+ );
42
+ // set defaults
43
+ if (empty($options)) {
44
+ update_option( 'wp_review_options', $options = $default_options );
45
+ }
46
+ if (empty($options['image_sizes'])) $options['image_sizes'] = array();
47
+
48
+ $opt_name = 'wp_review_options_'.wp_get_theme();
49
+ $options_updated = get_option( $opt_name );
50
+ $suggest_theme_defaults = true;
51
+ if (!empty($_GET['wp-review-theme-defaults']) && empty($_GET['settings-updated'])) {
52
+ wp_review_theme_defaults($options_updated, true);
53
+ $options = get_option('wp_review_options');
54
+ $suggest_theme_defaults = false;
55
+ }
56
+ // test to see if we need to sugges setting theme defaults
57
+ if (empty($options_updated)) $options_updated = array();
58
+ $opts_tmp = array_merge($options, $options_updated);
59
+ if ($opts_tmp == $options) $suggest_theme_defaults = false;
60
+ ?>
61
+ <div id="poststuff" class="wrap wp-review">
62
+ <div id="post-body">
63
+ <div id="col-right" style="float: left;">
64
+ <h2><?php _e('WP Review Settings', 'wp-review'); ?></h2>
65
+
66
+ <form method="post" action="options.php">
67
+ <?php settings_fields( 'wpreview-settings-group' ); ?>
68
+
69
+ <?php
70
+ $defaultColors = apply_filters('wp_review_default_colors', array(
71
+ 'color' => '#1e73be',
72
+ 'fontcolor' => '#555555',
73
+ 'bgcolor1' => '#e7e7e7',
74
+ 'bgcolor2' => '#ffffff',
75
+ 'bordercolor' => '#e7e7e7'
76
+ ));
77
+ $defaultLocation = apply_filters('wp_review_default_location', 'bottom');
78
+
79
+ $defaultCriteria = apply_filters('wp_review_default_criteria', array());
80
+ $defaultItems = array();
81
+ foreach ($defaultCriteria as $item) {
82
+ $defaultItems[] = array( 'wp_review_item_title' => $item, 'wp_review_item_star' => '');
83
+ }
84
+ $options['colors'] = apply_filters( 'wp_review_colors', $options['colors'], 0 );
85
+ if (!isset($options['deafults'])) $options['deafults'] = array();
86
+ /* Retrieve an existing value from the database. */
87
+ $items = ! empty($options['default_features']) ? $options['default_features'] : '';
88
+ $color = ! empty($options['colors']['color']) ? $options['colors']['color'] : '';
89
+ $location = ! empty($options['review_location']) ? $options['review_location'] : '';
90
+ $fontcolor = ! empty($options['colors']['fontcolor']) ? $options['colors']['fontcolor'] : '';
91
+ $bgcolor1 = ! empty($options['colors']['bgcolor1']) ? $options['colors']['bgcolor1'] : '';
92
+ $bgcolor2 = ! empty($options['colors']['bgcolor2']) ? $options['colors']['bgcolor2'] : '';
93
+ $bordercolor = ! empty($options['colors']['bordercolor']) ? $options['colors']['bordercolor'] : '';
94
+
95
+ if ( $items == '' ) $items = $defaultItems;
96
+ if( $color == '' ) $color = $defaultColors['color'];
97
+ if( $location == '' ) $location = $defaultLocation;
98
+ if( $fontcolor == '' ) $fontcolor = $defaultColors['fontcolor'];
99
+ if( $bgcolor1 == '' ) $bgcolor1 = $defaultColors['bgcolor1'];
100
+ if( $bgcolor2 == '' ) $bgcolor2 = $defaultColors['bgcolor2'];
101
+ if( $bordercolor == '' ) $bordercolor = $defaultColors['bordercolor'];
102
+
103
+ $fields = array(
104
+ 'location' => true,
105
+ 'color' => true,
106
+ 'fontcolor' => true,
107
+ 'bgcolor1' => true,
108
+ 'bgcolor2' => true,
109
+ 'bordercolor' => true,
110
+ 'custom_colors' => true,
111
+ 'custom_location' => true,
112
+ 'width' => true,
113
+ 'align' => true
114
+ );
115
+ $displayed_fields = apply_filters('wp_review_metabox_item_fields', $fields);
116
+
117
+ $location = apply_filters( 'wp_review_location', $location, 0 );
118
+ if (has_filter('wp_review_location')) echo '<p class="wp-review-filter-msg"><div class="dashicons dashicons-info"></div>'.__('There is a filter set for the review location that may modify the options below.', 'wp-review').'</p>';
119
+
120
+ if ($suggest_theme_defaults) { ?>
121
+ <div class="wp-review-theme-defaults-msg updated settings-error">
122
+ <p class="wp-review-field">
123
+ <?php _e('The current theme provides default settings for the plugin.', 'wp-review'); ?><br />
124
+ </p>
125
+ <a href="<?php echo admin_url('options-general.php?page=wp-review/admin/options.php&wp-review-theme-defaults=1'); ?>" class="button button-primary"><?php _e('Set to theme defaults', 'wp-review'); ?></a>
126
+ <a href="#" class="dashicons dashicons-no-alt close-notice"></a>
127
+ </div>
128
+ <?php } ?>
129
+
130
+ <p class="wp-review-field">
131
+ <label for="wp_review_location"><?php _e( 'Review Location', 'wp-review' ); ?></label>
132
+ <select name="wp_review_options[review_location]" id="wp_review_location">
133
+ <option value="bottom" <?php selected( $location, 'bottom' ); ?>><?php _e( 'After Content', 'wp-review' ) ?></option>
134
+ <option value="top" <?php selected( $location, 'top' ); ?>><?php _e( 'Before Content', 'wp-review' ) ?></option>
135
+ <option value="custom" <?php selected( $location, 'custom' ); ?>><?php _e( 'Custom (use shortcode)', 'wp-review' ) ?></option>
136
+ </select>
137
+ </p>
138
+
139
+ <p class="wp-review-field" id="wp_review_shortcode_hint_field">
140
+
141
+ <input id="wp_review_shortcode_hint" type="text" value="[wp-review]" readonly="readonly" />
142
+ <span><?php _e('Copy &amp; paste this shortcode in the post content.', 'wp-review') ?></span>
143
+ </p>
144
+
145
+ <?php if (has_filter('wp_review_colors')) echo '<p class="wp-review-filter-msg"><div class="dashicons dashicons-info"></div>'.__('There is a filter set for the review colors that may modify the options below.', 'wp-review').'</p>'; ?>
146
+
147
+ <div class="wp-review-color-options">
148
+ <p class="wp-review-field"<?php if (empty($displayed_fields['color'])) echo ' style="display: none;"'; ?>>
149
+ <label for="wp_review_color"><?php _e( 'Review Color', 'wp-review' ); ?></label>
150
+ <input type="text" class="wp-review-color" name="wp_review_options[colors][color]" value="<?php echo $color; ?>" />
151
+ </p>
152
+
153
+ <p class="wp-review-field"<?php if (empty($displayed_fields['fontcolor'])) echo ' style="display: none;"'; ?>>
154
+ <label for="wp_review_fontcolor"><?php _e( 'Font Color', 'wp-review' ); ?></label>
155
+ <input type="text" class="wp-review-color" name="wp_review_options[colors][fontcolor]" id ="wp_review_fontcolor" value="<?php echo $fontcolor; ?>" />
156
+ </p>
157
+
158
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bgcolor1'])) echo ' style="display: none;"'; ?>>
159
+ <label for="wp_review_bgcolor1"><?php _e( 'Heading Background Color', 'wp-review' ); ?></label>
160
+ <input type="text" class="wp-review-color" name="wp_review_options[colors][bgcolor1]" id ="wp_review_bgcolor1" value="<?php echo $bgcolor1; ?>" />
161
+ </p>
162
+
163
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bgcolor2'])) echo ' style="display: none;"'; ?>>
164
+ <label for="wp_review_bgcolor2"><?php _e( 'Background Color', 'wp-review' ); ?></label>
165
+ <input type="text" class="wp-review-color" name="wp_review_options[colors][bgcolor2]" id="wp_review_bgcolor2" value="<?php echo $bgcolor2; ?>" />
166
+ </p>
167
+
168
+ <p class="wp-review-field"<?php if (empty($displayed_fields['bordercolor'])) echo ' style="display: none;"'; ?>>
169
+ <label for="wp_review_bordercolor"><?php _e( 'Border Color', 'wp-review' ); ?></label>
170
+ <input type="text" class="wp-review-color" name="wp_review_options[colors][bordercolor]" id="wp_review_bordercolor" value="<?php echo $bordercolor; ?>" />
171
+ </p>
172
+ </div>
173
+
174
+ <div class="wp-review-default-features" style="display: block;">
175
+ <!-- Start repeater field -->
176
+ <table id="wp-review-item" class="wp-review-item" width="100%">
177
+
178
+ <thead>
179
+ <tr>
180
+ <th width="90%">
181
+ <?php if (has_filter('wp_review_default_criteria')) echo '<p class="wp-review-filter-msg"><div class="dashicons dashicons-info"></div>'.__('Default features are set by a filter function. Remove it to change.', 'wp-review').'</p>'; else _e( 'Default features', 'wp-review' ); ?>
182
+ </th>
183
+ <th width="10%"></th>
184
+ </tr>
185
+ </thead>
186
+
187
+ <tbody>
188
+ <?php if (has_filter('wp_review_default_criteria')) { ?>
189
+ <?php foreach ( $defaultCriteria as $item ) { ?>
190
+ <tr>
191
+ <td>
192
+ <input type="text" class="widefat" name="wp_review_options[default_features][]" value="<?php if( !empty( $item ) ) echo esc_attr( $item ); ?>" disabled="disabled" readonly="readonly" />
193
+ </td>
194
+ <td></td>
195
+ </tr>
196
+ <?php } ?>
197
+ <?php } else { ?>
198
+ <?php if ( !empty($items) ) : ?>
199
+ <?php foreach ( $items as $item ) { ?>
200
+
201
+ <tr>
202
+ <td>
203
+ <input type="text" class="widefat" name="wp_review_options[default_features][]" value="<?php if( !empty( $item ) ) echo esc_attr( $item ); ?>" />
204
+ </td>
205
+ <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
206
+ </tr>
207
+ <?php } ?>
208
+ <?php endif; ?>
209
+ <?php } ?>
210
+ <!-- empty hidden one for jQuery -->
211
+ <tr class="empty-row screen-reader-text">
212
+ <td><input type="text" class="widefat" data-name="wp_review_options[default_features][]" /></td>
213
+ <td><a class="button remove-row" href="#"><?php _e( 'Delete', 'wp-review' ); ?></a></td>
214
+ </tr>
215
+
216
+ </tbody>
217
+
218
+ </table>
219
+ <?php if ( ! has_filter('wp_review_default_criteria') ) { ?>
220
+ <table width="100%">
221
+ <tr>
222
+ <td width="100%"><a id="add-row" class="button" href="#"><?php _e( 'Add default feature', 'wp-review' ) ?></a></td>
223
+ </tr>
224
+ </table>
225
+ <?php } ?>
226
+ </div>
227
+
228
+ <p class="submit">
229
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
230
+ </p>
231
+
232
+ </form>
233
+ </div>
234
+ <div id="col-left" style="float: right">
235
+ <a href="https://mythemeshop.com/plugins/wp-review-pro/" target="_blank">
236
+ <img src="<?php echo trailingslashit( WP_REVIEW_ASSETS ); ?>/images/wp-review-pro.jpg">
237
+ </a>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ <?php }
242
+
243
+ // Add settings link on plugin page
244
+ function wpreview_plugin_settings_link($links) {
245
+ $dir = explode('/', WP_REVIEW_PLUGIN_BASE);
246
+ $dir = $dir[0];
247
+ $settings_link = '<a href="options-general.php?page='.$dir.'/admin/options.php">'.__('Settings', 'wp-review').'</a>';
248
+ array_unshift($links, $settings_link);
249
+ return $links;
250
+ }
251
+ add_filter('plugin_action_links_'.WP_REVIEW_PLUGIN_BASE, 'wpreview_plugin_settings_link' );
252
+
253
+ ?>
assets/css/admin.css CHANGED
@@ -1,51 +1,20 @@
1
- .wp-review-field label {
2
- width: 15%;
3
- display: inline-block;
4
- *display: inline;
5
- *zoom: 1;
6
- }
7
-
8
- .wp-review-field select {
9
- width: 15em;
10
- }
11
-
12
- .wp-review-field .wp-color-result {
13
- margin: 0;
14
- }
15
-
16
- .wp-review-item th {
17
- text-align: left;
18
- }
19
-
20
- .has-border-bottom {
21
- border-bottom: 1px solid #ddd;
22
- margin-bottom: 20px;
23
- padding-bottom: 20px;
24
- }
25
-
26
- .review-total {
27
- text-align: right;
28
- }
29
-
30
- .wp-picker-holder {
31
- position: absolute;
32
- z-index: 9;
33
- }
34
-
35
- #wp-review-item .review-value-incorrect {
36
- border-color: #F00;
37
- }
38
-
39
- #wp_review_shortcode_hint_field span {
40
- color: #777;
41
- font-style: italic;
42
- display: block;
43
- margin-left: 116px;
44
- margin-top: 2px;
45
- }
46
- #wp_review_shortcode_hint {
47
- width: 94px;
48
- }
49
- #wp_review_id_hint {
50
- margin-left: 8px;
51
- }
1
+ .wp-review-field label { width: 15%; display: inline-block; *display: inline; *zoom: 1; }
2
+ .wp-review-field select { width: 15em }
3
+ .wp-review-field .wp-color-result { margin: 0 }
4
+ .wp-review-item th { text-align: left }
5
+ .has-border-bottom { border-bottom: 1px solid #ddd; margin-bottom: 20px; padding-bottom: 20px; }
6
+ .review-total { text-align: right }
7
+ .wp-picker-holder { position: absolute; z-index: 9; }
8
+ #wp-review-item .review-value-incorrect { border-color: #F00 }
9
+ #wp_review_shortcode_hint_field span { color: #777; font-style: italic; display: block; margin-left: 116px; margin-top: 2px; }
10
+ #wp_review_shortcode_hint { width: 94px }
11
+ #wp_review_id_hint { margin-left: 8px }
12
+ .wp-review-admin-options .form-table td { padding: 20px 10px; vertical-align: top; }
13
+ .wp-review-admin-options p.description { font-weight: normal }
14
+ .wp-review-admin-options .wp-review-field label { width: 20% }
15
+ .wp-review-admin-options #wp_review_shortcode_hint_field span { display: inline; margin-left: 6px; }
16
+ .wp-review-theme-defaults-msg { position: relative }
17
+ .wp-review-theme-defaults-msg a.button { display: inline-block; margin-bottom: 8px; }
18
+ .wp-review-theme-defaults-msg a.close-notice { position: absolute; top: 0; right: 0; }
19
+ #wp-review-width-slider { width: 68%; float: right; margin-top: 8px; margin-right: 10px; }
20
+ #wp_review_width { width: 50px }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/wp-review-ie7.css CHANGED
@@ -1,8 +1,15 @@
1
- [class^="icon-"], [class*=" icon-"] {
2
- font-family: 'font-star';
3
- font-style: normal;
4
- font-weight: normal;
5
- line-height: 1em;
6
- }
7
-
 
 
 
 
 
 
 
8
  .icon-star { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
1
+ /*
2
+ * Plugin Name: WP Review
3
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4
+ * Description: Create reviews! Choose from Stars, Percentages or Points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5
+ * Author: MyThemesShop
6
+ * Author URI: http://mythemeshop.com/
7
+ */
8
+ [class^="icon-"], [class*=" icon-"] {
9
+ font-family: 'font-icons';
10
+ font-style: normal;
11
+ font-weight: normal;
12
+ line-height: 1em;
13
+ }
14
+
15
  .icon-star { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
assets/css/wp-review-tab-widget.css CHANGED
@@ -1,176 +1,42 @@
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
- .review-total-only.small-thumb {
146
- font-size: 15px;
147
- font-weight: bold;
148
- padding: 0 4px;
149
- margin-top: 4px;
150
- float: left;
151
- }
152
- .review-total-only.small-thumb.review-type-star {
153
- background: none;
154
- padding: 0;
155
- }
156
- .review-total-only.large-thumb {
157
- position: absolute;
158
- top: 0; right: 15px;
159
- }
160
- li:first-child .review-total-only.large-thumb {
161
- top: 5px;
162
- right: 15px;
163
- display: block;
164
- }
165
- .review-total-only.small-thumb .review-result-wrapper i {
166
- color: #444 !important;
167
- }
168
- .wp_review_tab_widget_content .has-4-tabs .tab_title.selected a {
169
- border-bottom: 1px solid #E4E4E4;
170
- }
171
- .wp_review_tab_widget_content .has-4-tabs .tab_title:nth-child(3) a {
172
- border-left: 0;
173
- }
174
- .title-right {
175
- overflow: hidden;
176
- }
1
+ /*
2
+ * Plugin Name: WP Review
3
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4
+ * Description: Create reviews! Choose from Stars, Percentages or Points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5
+ * Author: MyThemesShop
6
+ * Author URI: http://mythemeshop.com/
7
+ */
8
+ .wp_review_tab_widget_content { position: relative; border: 1px solid #E4E4E4; }
9
+ .wp_review_tab_widget_content img { max-width: 100%; height: auto; }
10
+ .wp_review_tab_widget_content a { color: #444 }
11
+ .wp_review_tab_widget_content ul.wp-review-tabs li { list-style: none; display: block; width: 50%; float: left; text-align: center; margin: 0; padding: 0 !important; }
12
+ .wp_review_tab_widget_content ul.has-1-tabs li { width: 100%; float: none; margin: 0 auto; }
13
+ .wp_review_tab_widget_content ul.has-2-tabs li { }
14
+ .wp_review_tab_widget_content ul.has-3-tabs li { width: 33.33% }
15
+ .wp_review_tab_widget_content ul.has-4-tabs li { width: 50% }
16
+ .wp_review_tab_widget_content .tab_title a { display: block; background: #f0f0f0; border-left: 1px solid #E4E4E4; border-bottom: 1px solid #E4E4E4; padding: 2px 0 4px; line-height: 2.4; text-decoration: none; position: relative; font-weight: bold; }
17
+ .wp_review_tab_widget_content .tab_title:first-child a { margin-left: 0; border-left: 0; }
18
+ .wp_review_tab_widget_content .tab_title.selected a { background: #fff; border-bottom: 1px solid #fff; }
19
+ .wp_review_tab_widget_content .inside { background: #fff; padding-top: 10px; }
20
+ .wp_review_tab_widget_content .tab-content li { list-style-type: none; float: left; width: 100%; -moz-box-sizing: border-box; box-sizing: border-box; margin: 0 0 15px 0; padding: 0px 15px 10px 15px; border-bottom: 1px solid #E4E4E4; text-align: left; color: #444; background: none; position: relative; }
21
+ .wp_review_tab_widget_content .tab-content li:last-child { border: none; margin-bottom: 0; }
22
+ .wp_review_tab_widget_content .tab-content li:first-child { padding-top: 5px }
23
+ .wp_review_tab_thumb_small { float: left; margin-right: 12px; padding-top: 4px; width: 65px; height: 65px; overflow: hidden; }
24
+ .wp_review_tab_thumb_large { float: none; max-width: 100%; display: inline-block; margin-bottom: 4px; position: relative; }
25
+ .wp_review_tab_widget_content .entry-title { font-weight: bold; margin: 0; padding: 0; }
26
+ .wp_review_tab_widget_content .wp-review-tab-postmeta { color: #999; font-size: 13px; float: right; margin-top: 5px; }
27
+ .wp_review_tab_widget_content .wp-post-image { margin: 0 !important }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /* Pagination */
29
+ .wp_review_tab_widget_content .wp-review-tab-pagination { margin: 0; width: 100%; padding-top: 0; padding-bottom: 15px; float: left; }
30
+ .wp_review_tab_widget_content .wp-review-tab-pagination a { margin: 0 15px }
31
+ .wp-review-tab-pagination a.next { float: right }
 
 
 
 
 
 
 
 
 
 
 
32
  /* Loading... */
33
+ .wp-review-tab-loading:after { content: ""; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(255,255,255,0.8); }
34
+ .clear { clear: both }
 
 
 
 
 
 
 
 
 
 
 
 
35
  /* Rating... */
36
+ .review-total-only.small-thumb { font-size: 15px; font-weight: bold; padding: 0 4px; margin-top: 4px; float: left; }
37
+ .review-total-only.small-thumb.review-type-star { background: none; padding: 0; }
38
+ .review-total-only.large-thumb { position: absolute; top: 0; right: 15px; }
39
+ li:first-child .review-total-only.large-thumb { top: 5px; right: 15px; display: block; }
40
+ .wp_review_tab_widget_content .has-4-tabs .tab_title.selected a { border-bottom: 1px solid #E4E4E4 }
41
+ .wp_review_tab_widget_content .has-4-tabs .tab_title:nth-child(3) a { border-left: 0 }
42
+ .title-right { overflow: hidden }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/wp-review.css CHANGED
@@ -1,420 +1,182 @@
1
- /*
2
- Plugin: WP Review
3
- Created By: MyThemeShop.com
4
- Version: 3.1
5
- */
6
- .review-wrapper {
7
- border: 1px solid #e7e7e7;
8
- margin-bottom: 1.5em;
9
- overflow: hidden;
10
- clear: both;
11
- }
12
-
13
- .review-title {
14
- background-color: #f6f6f6;
15
- border-bottom: 1px solid #e7e7e7;
16
- margin: 0;
17
- padding: 10px 15px;
18
- }
19
-
20
- .review-wrapper .review-list {
21
- margin: 0;
22
- list-style: none;
23
- padding: 0;
24
- }
25
-
26
- .review-list li {
27
- border-bottom: 1px solid #e7e7e7;
28
- padding: 10px 15px;
29
- position: relative;
30
- list-style: none;
31
- }
32
-
33
- .review-list li:nth-child(even) {
34
- background-color: #fafafa;
35
- }
36
-
37
- .review-list li:last-child {
38
- border-bottom: 1px solid #e7e7e7;
39
- }
40
-
41
- .review-summary-title {
42
- margin-bottom: 5px;
43
- }
44
-
45
- .review-desc {
46
- float: left;
47
- width: 75%;
48
- padding: 10px 15px;
49
- -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
50
- }
51
-
52
- .review-desc p:last-child {
53
- margin-bottom: 0;
54
- }
55
-
56
- .review-result-wrapper i {
57
- font-style: normal;
58
- font-size: 16px;
59
- }
60
-
61
- .review-result {
62
- position: absolute;
63
- top: 0;
64
- left: 0;
65
- height: 22px;
66
- overflow: hidden;
67
- white-space: nowrap;
68
- }
69
-
70
- .review-total-wrapper {
71
- float: right;
72
- margin: 0;
73
- margin-right: 0;
74
- padding-right: 0;
75
- position: relative;
76
- -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
77
- margin-right: 15px;
78
- }
79
-
80
- .review-total-wrapper span.review-total-box {
81
- border-top: 0;
82
- border-bottom: 0;
83
- border-left: 0;
84
- border-right: 0;
85
- display: block;
86
- font-size: 40px;
87
- font-weight: 700;
88
- text-align: right;
89
- margin: 0;
90
- padding: 35px 0 20px;
91
- width: 100%;
92
- -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
93
- }
94
- .review-total-wrapper span.review-total-box small{font-size: 12px; display: block;}
95
- /*.review-total-wrapper span.review-total-box.hidden{display: none;}*/
96
- .percentage-icon {
97
- font-size: 22px;
98
- position: relative;
99
- top: -14px;
100
- }
101
-
102
- .review-total-star {
103
- position: relative;
104
- margin-top: 5px;
105
- margin: 5px auto 15px auto;
106
- float: right;
107
- }
108
-
109
- .review-total-star.allowed-to-rate{margin-top:-10px;}
110
-
111
- .review-total-star.allowed-to-rate.has-not-rated-yet a{cursor: pointer;}
112
-
113
- .review-total-star.allowed-to-rate.has-not-rated-yet:hover .review-result {opacity: 0; filter: alpha(opacity=0); display:none}
114
- .review-total-star.allowed-to-rate.has-not-rated-yet a:hover > i{opacity: 1; filter: alpha(opacity=1);}
115
- .review-total-star.allowed-to-rate a.hovered i{opacity: 1; filter: alpha(opacity=1);}
116
- .mts-review-wait-msg{display: none;}
117
-
118
- .review-total {
119
- position: absolute;
120
- top: 0px;
121
- left: 0px;
122
- height: 16px;
123
- z-index: 99;
124
- text-indent: -9999px;
125
- }
126
-
127
- .review-star {
128
- position: absolute;
129
- right: 15px;
130
- top: 10px;
131
- }
132
-
133
-
134
-
135
- /**
136
- * Bar & Percentage Point
137
- */
138
- .bar-point .review-star,
139
- .percentage-point .review-star {
140
- position: relative;
141
- margin: 6px 0;
142
- top: 0;
143
- right: 0;
144
- }
145
-
146
- .bar-point .review-result-wrapper,
147
- .percentage-point .review-result-wrapper {
148
- background: rgba(0,0,0,0.1) 0 -24px repeat-x;
149
- width: 100%;
150
- height: 22px;
151
- }
152
-
153
- .bar-point .review-result,
154
- .percentage-point .review-result {
155
- position: absolute;
156
- top: 0px;
157
- left: 0px;
158
- height: 22px;
159
- z-index: 99;
160
- text-indent: -9999px;
161
- }
162
-
163
- .review-total-star.allowed-to-rate .review-result-wrapper{background: none;}
164
- /**
165
- * Twenty series themes compatibilty
166
- */
167
- .entry-content .review-title,
168
- #content .review-title {
169
- margin: 0;
170
- }
171
-
172
- .entry-content .review-wrapper li {
173
- margin: 0;
174
- }
175
-
176
- .entry-content .review-summary-title,
177
- #content .review-summary-title {
178
- margin-bottom: 5px;
179
- }
180
-
181
- #content .review-list {
182
- margin: 0;
183
- }
184
-
185
- #content .review-desc p:last-child {
186
- margin-bottom: 0;
187
- }
188
-
189
- /**
190
- * Basic styling for wp_review_display_total
191
- */
192
- .review-total-only {
193
- padding: 3px 10px;
194
- background: rgba(0, 0, 0, 0.6);
195
- color:#fff;
196
- font-size:13px;
197
-
198
- display: inline-block;
199
- }
200
- .review-total-only .percentage-icon {
201
- font-size: inherit;
202
- top: 0;
203
- }
204
- .review-total-only .review-type-star {
205
- font-size:12px;
206
- padding: 3px 6px;
207
- }
208
- .review-total-only .review-total-star {
209
- font-size:12px;
210
- margin: 0;
211
- }
212
- .review-total-only .review-result-wrapper i {
213
- color: #FFF !important;
214
- opacity: 0.50;
215
- filter: alpha(opacity=50);
216
- }
217
- .review-total-only .review-result-wrapper .review-result i {
218
- opacity: 1;
219
- filter: alpha(opacity=100);
220
- }
221
-
222
- /**
223
- * Users review area
224
- */
225
- .user-review-area{ border-top: 1px solid #e7e7e7; margin-top: -1.5em; overflow: hidden; padding: 10px 15px; position: relative; clear: both;}
226
- .user-total-wrapper{float: left; margin:0; }
227
- .review-total-star.allowed-to-rate{float: right; margin:0;}
228
- .user-total-wrapper .user-review-title{/*font-size: 20px;*/ font-weight: bold;margin:0;}
229
- .user-total-wrapper #mts-user-reviews-total{/*font-size: 20px;*/}
230
- /*.user-total-wrapper small{font-size:16px;}*/
231
- /*#review.review-wrapper{float: left; width: 45%;}*/
232
-
233
- /**
234
- * Font icon
235
- */
236
- @font-face {
237
- font-family: 'font-star';
238
- src: url('../fonts/font-star.eot?75880836');
239
- src: url('../fonts/font-star.eot?75880836#iefix') format('embedded-opentype'),
240
- url('../fonts/font-star.woff?75880836') format('woff'),
241
- url('../fonts/font-star.ttf?75880836') format('truetype'),
242
- url('../fonts/font-star.svg?75880836#font-star') format('svg');
243
- font-weight: normal;
244
- font-style: normal;
245
- }
246
-
247
- [class^="mts-icon-"]:before, [class*=" mts-icon-"]:before {
248
- font-family: "font-star";
249
- font-style: normal;
250
- font-weight: normal;
251
- speak: none;
252
- display: inline-block;
253
- text-decoration: inherit;
254
- width: 1em;
255
- margin-right: 0;
256
- text-align: center;
257
- font-variant: normal;
258
- text-transform: none;
259
- line-height: 1em;
260
- margin-left: 2px;
261
- }
262
-
263
- .mts-icon-star:before { content: '\e800'; }
264
-
265
- @font-face {
266
- font-family: 'font-loader';
267
- src: url('../fonts/font-loader.eot?75880836');
268
- src: url('../fonts/font-loader.eot?75880836#iefix') format('embedded-opentype'),
269
- url('../fonts/font-loader.woff?75880836') format('woff'),
270
- url('../fonts/font-loader.ttf?75880836') format('truetype'),
271
- url('../fonts/font-loader.svg?75880836#font-loader') format('svg');
272
- font-weight: normal;
273
- font-style: normal;
274
- }
275
-
276
- [class*="mts-icon-loader"]:before {
277
- font-family: "font-loader";
278
- font-style: normal;
279
- font-weight: normal;
280
- speak: none;
281
-
282
- display: inline-block;
283
- text-decoration: inherit;
284
- width: 1em;
285
- margin-right: .2em;
286
- text-align: center;
287
- /* opacity: .8; */
288
-
289
- /* For safety - reset parent styles, that can break glyph codes*/
290
- font-variant: normal;
291
- text-transform: none;
292
-
293
- /* fix buttons height, for twitter bootstrap */
294
- line-height: 1em;
295
-
296
- /* Animation center compensation - margins should be symmetric */
297
- /* remove if not needed */
298
- margin-left: .2em;
299
-
300
- /* you can be more comfortable with increased icons size */
301
- /* font-size: 120%; */
302
-
303
- /* Uncomment for 3D effect */
304
- /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
305
- }
306
-
307
-
308
-
309
-
310
- /*
311
- Spin Animation For Loader
312
- */
313
-
314
-
315
- .mts-icon-loader:before { content: '\e800'; } /* '' */
316
-
317
- .animate-spin {
318
- -moz-animation: spin 1s infinite linear;
319
- -o-animation: spin 1s infinite linear;
320
- -webkit-animation: spin 1s infinite linear;
321
- animation: spin 1s infinite linear;
322
- display: inline-block;
323
- }
324
- @-moz-keyframes spin {
325
- 0% {
326
- -moz-transform: rotate(0deg);
327
- -o-transform: rotate(0deg);
328
- -webkit-transform: rotate(0deg);
329
- transform: rotate(0deg);
330
- }
331
-
332
- 100% {
333
- -moz-transform: rotate(359deg);
334
- -o-transform: rotate(359deg);
335
- -webkit-transform: rotate(359deg);
336
- transform: rotate(359deg);
337
- }
338
- }
339
- @-webkit-keyframes spin {
340
- 0% {
341
- -moz-transform: rotate(0deg);
342
- -o-transform: rotate(0deg);
343
- -webkit-transform: rotate(0deg);
344
- transform: rotate(0deg);
345
- }
346
-
347
- 100% {
348
- -moz-transform: rotate(359deg);
349
- -o-transform: rotate(359deg);
350
- -webkit-transform: rotate(359deg);
351
- transform: rotate(359deg);
352
- }
353
- }
354
- @-o-keyframes spin {
355
- 0% {
356
- -moz-transform: rotate(0deg);
357
- -o-transform: rotate(0deg);
358
- -webkit-transform: rotate(0deg);
359
- transform: rotate(0deg);
360
- }
361
-
362
- 100% {
363
- -moz-transform: rotate(359deg);
364
- -o-transform: rotate(359deg);
365
- -webkit-transform: rotate(359deg);
366
- transform: rotate(359deg);
367
- }
368
- }
369
- @-ms-keyframes spin {
370
- 0% {
371
- -moz-transform: rotate(0deg);
372
- -o-transform: rotate(0deg);
373
- -webkit-transform: rotate(0deg);
374
- transform: rotate(0deg);
375
- }
376
-
377
- 100% {
378
- -moz-transform: rotate(359deg);
379
- -o-transform: rotate(359deg);
380
- -webkit-transform: rotate(359deg);
381
- transform: rotate(359deg);
382
- }
383
- }
384
- @keyframes spin {
385
- 0% {
386
- -moz-transform: rotate(0deg);
387
- -o-transform: rotate(0deg);
388
- -webkit-transform: rotate(0deg);
389
- transform: rotate(0deg);
390
- }
391
-
392
- 100% {
393
- -moz-transform: rotate(359deg);
394
- -o-transform: rotate(359deg);
395
- -webkit-transform: rotate(359deg);
396
- transform: rotate(359deg);
397
- }
398
- }
399
-
400
- /*-----------------------------------------------------*/
401
- /* Responsvie
402
- /*-----------------------------------------------------*/
403
- @media screen and (max-width:1040px) {
404
- .review-desc { width: 71%;}
405
- /*.review-total-wrapper { width: 26.8%; }*/
406
- }
407
-
408
- @media screen and (max-width:860px) {
409
- .review-desc { width: 66%;}
410
- /*.review-total-wrapper { width: 31.8%; }*/
411
- }
412
- @media screen and (max-width:470px) {
413
- .review-desc { padding: 4%; width: 100%;}
414
- .review-total-wrapper { width: 100%; margin-right: 0;}
415
- .review-total-wrapper span.review-total-box { padding: 10px 0 20px; text-align: left; padding-left: 10px;}
416
- .review-total-star { position: absolute; right: 20px; top: 5px;}
417
- .user-total-wrapper{width: 96%;}
418
- .review-total-star.allowed-to-rate{position: relative; right: auto;left: 0;float: left;}
419
-
420
  }
1
+ /*
2
+ * Plugin Name: WP Review
3
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4
+ * Description: Create reviews! Choose from Stars, Percentages or Points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5
+ * Version: 3.2
6
+ * Author: MyThemesShop
7
+ * Author URI: http://mythemeshop.com/
8
+ */
9
+ .review-wrapper { border: 1px solid #e7e7e7; margin-bottom: 1.5em; overflow: hidden; clear: both; }
10
+ .review-title { background-color: #f6f6f6; border-bottom: 1px solid #e7e7e7; margin: 0; padding: 10px 15px; }
11
+ .review-wrapper .review-list { margin: 0; list-style: none; padding: 0; }
12
+ .review-list li { border-bottom: 1px solid #e7e7e7; padding: 10px 15px; position: relative; list-style: none; }
13
+ .review-list li:nth-child(even) { background-color: #fafafa }
14
+ .review-list li:last-child { border-bottom: 1px solid #e7e7e7 }
15
+ .review-summary-title { margin-bottom: 5px }
16
+ .review-desc { float: left; width: 75%; padding: 10px 15px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
17
+ .review-desc p:last-child { margin-bottom: 0 }
18
+ .review-result-wrapper i { font-style: normal; font-size: 16px; }
19
+ .review-result { position: absolute; top: 0; left: 0; height: 22px; overflow: hidden; white-space: nowrap; }
20
+ .review-total-wrapper { float: right; margin: 0; margin-right: 0; padding-right: 0; position: relative; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; margin-right: 15px; }
21
+ .review-total-wrapper span.review-total-box { border-top: 0; border-bottom: 0; border-left: 0; border-right: 0; display: block; font-size: 40px; font-weight: 700; text-align: right; margin: 0; padding: 35px 0 20px; width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
22
+ .review-total-wrapper span.review-total-box small { font-size: 12px; display: block; }
23
+ .percentage-icon { font-size: 22px; position: relative; top: -14px; }
24
+ .review-total-star { position: relative; margin-top: 5px; margin: 5px auto 15px auto; float: right; }
25
+ .review-total-star.allowed-to-rate { margin-top: -10px }
26
+ .review-total-star.allowed-to-rate.has-not-rated-yet a { cursor: pointer }
27
+ .review-total-star.allowed-to-rate.has-not-rated-yet:hover .review-result { opacity: 0; filter: alpha(opacity=0); display: none; }
28
+ .review-total-star.allowed-to-rate.has-not-rated-yet a:hover > i { opacity: 1; filter: alpha(opacity=1); }
29
+ .review-total-star.allowed-to-rate a.hovered i { opacity: 1; filter: alpha(opacity=1); }
30
+ .mts-review-wait-msg { display: none }
31
+ .review-total { position: absolute; top: 0px; left: 0px; height: 16px; z-index: 99; text-indent: -9999px; }
32
+ .review-star { position: absolute; right: 15px; top: 10px; }
33
+ /**
34
+ * Bar & Percentage Point
35
+ */
36
+ .bar-point .review-star, .percentage-point .review-star { position: relative; margin: 6px 0; top: 0; right: 0; }
37
+ .bar-point .review-result-wrapper, .percentage-point .review-result-wrapper { background: rgba(0,0,0,0.1) 0 -24px repeat-x; width: 100%; height: 22px; }
38
+ .bar-point .review-result, .percentage-point .review-result { position: absolute; top: 0px; left: 0px; height: 22px; z-index: 99; text-indent: -9999px; }
39
+ .review-total-star.allowed-to-rate .review-result-wrapper { background: none }
40
+ /**
41
+ * Twenty series themes compatibilty
42
+ */
43
+ .entry-content .review-title, #content .review-title { margin: 0 }
44
+ .entry-content .review-wrapper li { margin: 0 }
45
+ .entry-content .review-summary-title, #content .review-summary-title { margin-bottom: 5px }
46
+ #content .review-list { margin: 0 }
47
+ #content .review-desc p:last-child { margin-bottom: 0 }
48
+ /**
49
+ * Basic styling for wp_review_display_total
50
+ */
51
+ .review-total-only { padding: 3px 8px; background: #fff; display: inline-block; }
52
+ .review-total-only .percentage-icon { font-size: inherit; top: 0; }
53
+ .review-total-only .review-type-star { font-size: 12px; padding: 3px 6px; }
54
+ .review-total-only .review-total-star { font-size: 12px; margin: 0; }
55
+ .review-result-wrapper i { opacity: 0.50; filter: alpha(opacity=50); }
56
+ .review-result-wrapper .review-result i { opacity: 1; filter: alpha(opacity=100); }
57
+ /**
58
+ * Users review area
59
+ */
60
+ .user-review-area { border-top: 1px solid #e7e7e7; overflow: hidden; padding: 10px 15px; position: relative; clear: both; }
61
+ .user-total-wrapper { float: left; margin: 0; }
62
+ .review-total-star.allowed-to-rate { float: right; margin: 0; }
63
+ .user-total-wrapper .user-review-title { font-weight: bold;margin:0; }
64
+ /**
65
+ * Review in comments
66
+ */
67
+ .wp-review-comment-field { margin-bottom: 10px }
68
+ .review-comment-field-msg { margin-right: 12px }
69
+ .review-total-star-comments { position: relative; display: inline-block; }
70
+ .comment-text-inner { clear: both }
71
+ .wp-review-comment-field a { opacity: 0.5; filter: alpha(opacity=50); }
72
+ .wp-review-comment-field.allowed-to-rate a { cursor: pointer }
73
+ .wp-review-comment-field.allowed-to-rate.has-not-rated-yet a { }
74
+ .wp-review-comment-field.allowed-to-rate .review-result-wrapper:hover a { opacity: 0.5; filter: alpha(opacity=50); }
75
+ .wp-review-comment-field.allowed-to-rate .review-result-wrapper:hover .review-result { display: none }
76
+ .wp-review-comment-field.allowed-to-rate .review-result-wrapper a:hover { opacity: 1; filter: alpha(opacity=100); }
77
+ /**
78
+ * Show on thumbnails
79
+ */
80
+ .wp-review-thumbnail-wrapper { position: relative }
81
+ .wp-review-on-thumbnail { position: absolute; top: 0; right: 0; background: #fff; padding: 2px 4px; }
82
+ .wp-review-on-thumbnail.review-type-star .review-total-star { margin: 0 }
83
+ .review-type-circle.latestPost-review-wrapper, .review-type-circle.wp-review-on-thumbnail { height: 35px ; background: #fff;}
84
+ .latestPost-review-wrapper .wp-review-circle-rating, .wp-review-on-thumbnail .wp-review-circle-rating { font-size: 11px !important; }
85
+ .review-type-circle.review-total-only, .review-type-circle.wp-review-show-total { padding-top: 6px; }
86
+ .latestPost-review-wrapper i, .latestPost-review-wrapper span { color: #FFF!important; }
87
+ /**
88
+ * Font icon
89
+ */
90
+ @font-face {
91
+ font-family: 'font-icons';
92
+ src: url('../fonts/font-icons.eot');
93
+ src: url('../fonts/font-icons.eot') format('embedded-opentype'),
94
+ url('../fonts/font-icons.woff') format('woff'),
95
+ url('../fonts/font-icons.ttf') format('truetype'),
96
+ url('../fonts/font-icons.svg') format('svg');
97
+ font-weight: normal;
98
+ font-style: normal;
99
+ }
100
+
101
+ [class^="mts-icon-"]:before, [class*=" mts-icon-"]:before {
102
+ font-family: "font-icons";
103
+ font-style: normal;
104
+ font-weight: normal;
105
+ speak: none;
106
+ display: inline-block;
107
+ text-decoration: inherit;
108
+ width: 1em;
109
+ margin-right: 0;
110
+ text-align: center;
111
+ font-variant: normal;
112
+ text-transform: none;
113
+ line-height: 1em;
114
+ margin-left: 2px;
115
+ }
116
+
117
+ [class*="mts-icon-loader"]:before {
118
+ font-family: "font-icons";
119
+ font-style: normal;
120
+ font-weight: normal;
121
+ speak: none;
122
+ display: inline-block;
123
+ text-decoration: inherit;
124
+ width: 1em;
125
+ margin-right: .2em;
126
+ text-align: center;
127
+ font-variant: normal;
128
+ text-transform: none;
129
+ line-height: 1em;
130
+ margin-left: .2em;
131
+ }
132
+
133
+ .mts-icon-star:before { content: '\e800'; }
134
+ .mts-icon-loader:before { content: '\e801'; }
135
+
136
+ /*
137
+ Spin Animation For Loader
138
+ */
139
+ .animate-spin {
140
+ -moz-animation: spin 1s infinite linear;
141
+ -o-animation: spin 1s infinite linear;
142
+ -webkit-animation: spin 1s infinite linear;
143
+ animation: spin 1s infinite linear;
144
+ display: inline-block;
145
+ }
146
+ @-moz-keyframes spin {
147
+ 0% { -moz-transform: rotate(0deg); -o-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); }
148
+ 100% { -moz-transform: rotate(359deg); -o-transform: rotate(359deg); -webkit-transform: rotate(359deg); transform: rotate(359deg); }
149
+ }
150
+ @-webkit-keyframes spin {
151
+ 0% { -moz-transform: rotate(0deg); -o-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); }
152
+ 100% { -moz-transform: rotate(359deg); -o-transform: rotate(359deg); -webkit-transform: rotate(359deg); transform: rotate(359deg); }
153
+ }
154
+ @-o-keyframes spin {
155
+ 0% { -moz-transform: rotate(0deg); -o-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); }
156
+ 100% { -moz-transform: rotate(359deg); -o-transform: rotate(359deg); -webkit-transform: rotate(359deg); transform: rotate(359deg); }
157
+ }
158
+ @-ms-keyframes spin {
159
+ 0% { -moz-transform: rotate(0deg); -o-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); }
160
+ 100% { -moz-transform: rotate(359deg); -o-transform: rotate(359deg); -webkit-transform: rotate(359deg); transform: rotate(359deg); }
161
+ }
162
+ @keyframes spin {
163
+ 0% { -moz-transform: rotate(0deg); -o-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); }
164
+ 100% { -moz-transform: rotate(359deg); -o-transform: rotate(359deg); -webkit-transform: rotate(359deg); transform: rotate(359deg); }
165
+ }
166
+ /*-----------------------------------------------------*/
167
+ /* Responsvie
168
+ /*-----------------------------------------------------*/
169
+ @media screen and (max-width:1040px) {
170
+ .review-desc { width: 71% }
171
+ }
172
+ @media screen and (max-width:860px) {
173
+ .review-desc { width: 66% }
174
+ }
175
+ @media screen and (max-width:470px) {
176
+ .review-desc { padding: 4%; width: 100%; }
177
+ .review-total-wrapper { width: 100%; margin-right: 0; }
178
+ .review-total-wrapper span.review-total-box { padding: 10px 0 20px; text-align: left; padding-left: 10px; }
179
+ .review-total-star { position: absolute; right: 20px; top: 5px; }
180
+ .user-total-wrapper { width: 96% }
181
+ .review-total-star.allowed-to-rate { position: relative; right: auto; left: 0; float: left; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  }
assets/fonts/font-icons.eot ADDED
Binary file
assets/fonts/font-icons.svg ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="font-icons" horiz-adv-x="1000" >
7
+ <font-face font-family="font-icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="star" unicode="&#xe800;" d="m0 489q0 21 31 26l280 40 126 254q11 23 27 23t28-23l125-254 280-40q32-5 32-26 0-12-15-27l-203-197 48-279q1-4 1-12 0-11-6-19t-17-9q-10 0-22 7l-251 132-250-132q-13-7-23-7-11 0-17 9t-6 19q0 4 1 12l48 279-203 197q-14 15-14 27z" horiz-adv-x="928.6" />
10
+ <glyph glyph-name="spin3" unicode="&#xe801;" d="m494 850c-266 0-483-210-494-472-1-19 13-20 13-20l84 0c16 0 19 10 19 18 10 199 176 358 378 358 107 0 205-45 273-118l-58-57c-11-12-11-27 5-31l247-50c21-5 46 11 37 44l-58 227c-2 9-16 22-29 13l-65-60c-89 91-214 148-352 148z m409-508c-16 0-19-10-19-18-10-199-176-358-377-358-108 0-205 45-274 118l59 57c10 12 10 27-5 31l-248 50c-21 5-46-11-37-44l58-227c2-9 16-22 30-13l64 60c89-91 214-148 353-148 265 0 482 210 493 473 1 18-13 19-13 19l-84 0z" horiz-adv-x="1000" />
11
+ </font>
12
+ </defs>
13
+ </svg>
assets/fonts/font-icons.ttf ADDED
Binary file
assets/fonts/font-icons.woff ADDED
Binary file
assets/fonts/font-loader.eot DELETED
Binary file
assets/fonts/font-loader.svg DELETED
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2013 by original authors @ fontello.com</metadata>
5
- <defs>
6
- <font id="fontello" horiz-adv-x="1000" >
7
- <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
- <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="spin3" unicode="&#xe800;" d="m494 850c-266 0-483-210-494-472c-1-19 13-20 13-20l84 0c16 0 19 10 19 18c10 199 176 358 378 358c107 0 205-45 273-118l-58-57c-11-12-11-27 5-31l247-50c21-5 46 11 37 44l-58 227c-2 9-16 22-29 13l-65-60c-89 91-214 148-352 148z m409-508c-16 0-19-10-19-18c-10-199-176-358-377-358c-108 0-205 45-274 118l59 57c10 12 10 27-5 31l-248 50c-21 5-46-11-37-44l58-227c2-9 16-22 30-13l64 60c89-91 214-148 353-148c265 0 482 210 493 473c1 18-13 19-13 19l-84 0z" horiz-adv-x="1000" />
10
- </font>
11
- </defs>
12
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/font-loader.ttf DELETED
Binary file
assets/fonts/font-loader.woff DELETED
Binary file
assets/fonts/font-star.eot DELETED
Binary file
assets/fonts/font-star.svg DELETED
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2013 by original authors @ fontello.com</metadata>
5
- <defs>
6
- <font id="font-star" horiz-adv-x="1000" >
7
- <font-face font-family="font-star" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
- <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="star" unicode="&#xe800;" d="m929 489q0-12-15-27l-203-197l48-279q1-4 1-12q0-11-6-19t-17-9q-10 0-22 7l-251 132l-250-132q-13-7-23-7q-11 0-17 9t-6 19q0 4 1 12l48 279l-203 197q-14 15-14 27q0 21 31 26l280 40l126 254q11 23 27 23t28-23l125-254l280-40q32-5 32-26z" horiz-adv-x="928.6" />
10
- </font>
11
- </defs>
12
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
assets/fonts/font-star.ttf DELETED
Binary file
assets/fonts/font-star.woff DELETED
Binary file
assets/images/largethumb.png CHANGED
Binary file
assets/images/smallthumb.png CHANGED
Binary file
assets/images/wp-review-pro.jpg ADDED
Binary file
assets/js/admin.js CHANGED
@@ -1,157 +1,200 @@
1
- var $ = jQuery.noConflict();
2
- $(document).ready(function() {
3
-
4
- /**
5
- * Repeatable field
6
- */
7
- $('#add-row').on('click', function(e) {
8
- e.preventDefault();
9
- var row = $('.empty-row.screen-reader-text').clone(true);
10
- row.removeClass('empty-row screen-reader-text');
11
- row.insertBefore('#wp-review-item tbody>tr:last');
12
- row.find("[name='wp_review_item_star[]']").addClass('review-star');
13
- $.review_total();
14
- });
15
-
16
- $('.remove-row').on('click', function(e) {
17
- e.preventDefault();
18
- $(this).parents('tr').remove();
19
- $.review_total();
20
- });
21
-
22
- /**
23
- * Toggle meta box
24
- */
25
- $('#wp-review-metabox-item').hide();
26
- $('#wp-review-metabox-heading').hide();
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
-
34
- $('#wp-review-metabox-item').toggle( $(this).val() != '' );
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)');
42
- }
43
-
44
- if ( $(this).val() == 'star' ) {
45
- $('.dynamic-text').text('Star (1-5)');
46
- }
47
-
48
- if ( $(this).val() == 'percentage' ) {
49
- $('.dynamic-text').text('Percentage (1-100)');
50
- }
51
-
52
- $.validate_review_value();
53
-
54
- });
55
-
56
- if ( $('#wp_review_type option:selected').val() === 'star' ) {
57
- $('#wp-review-metabox-item').show();
58
- $('#wp-review-metabox-heading').show();
59
- $('#wp-review-metabox-desc').show();
60
- $('#wp-review-metabox-userReview').show();
61
- }
62
-
63
- if ( $('#wp_review_type option:selected').val() === 'point' ) {
64
- $('.dynamic-text').text('Points (1-10)');
65
- $('#wp-review-metabox-item').show();
66
- $('#wp-review-metabox-heading').show();
67
- $('#wp-review-metabox-desc').show();
68
- $('#wp-review-metabox-userReview').show();
69
- }
70
-
71
- if ( $('#wp_review_type option:selected').val() === 'percentage' ) {
72
- $('.dynamic-text').text('Percentage (1-100)');
73
- $('#wp-review-metabox-item').show();
74
- $('#wp-review-metabox-heading').show();
75
- $('#wp-review-metabox-desc').show();
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
- });
86
- $('#wp_review_shortcode_hint').click(function() {
87
- $(this).select();
88
- });
89
- if ($('#wp_review_location').val() == 'custom') {
90
- $('#wp_review_shortcode_hint_field').show();
91
- }
92
-
93
- /**
94
- * Review total
95
- */
96
- $.extend({
97
-
98
- review_total: function(){
99
- $('.review-star').on( 'change', function () {
100
-
101
- var sum = 0,
102
- value = 0,
103
- input = $('.review-star').length;
104
-
105
- $('.review-star').each(function () {
106
- value = Number($(this).val());
107
- if (!isNaN(value)) sum += value / input;
108
- });
109
-
110
- $('.wp-review-total').val( Math.round(sum * 10) / 10 );
111
-
112
- $.validate_review_value();
113
-
114
- });
115
-
116
- },
117
-
118
- validate_review_value: function(){
119
-
120
- var type = $('#wp_review_type'),
121
- fields = $('input.review-star'),
122
- minval = 0,
123
- maxval = 999;
124
-
125
- if ( type.val() == 'point' ) {
126
- minval = 1;
127
- maxval = 10;
128
- } else if ( type.val() == 'star' ) {
129
- minval = 1;
130
- maxval = 5;
131
- } else if ( type.val() == 'percentage' ) {
132
- minval = 1;
133
- maxval = 100;
134
- }
135
-
136
- fields.each(function () {
137
- var value = Number($(this).val());
138
- if ( (value) && (value<minval || value>maxval) )
139
- $(this).addClass('review-value-incorrect');
140
- else
141
- $(this).removeClass('review-value-incorrect');
142
- });
143
-
144
- },
145
-
146
- });
147
-
148
- $.review_total();
149
- $.validate_review_value();
150
- $('.review-star').trigger('change');
151
-
152
- /**
153
- * Color picker setup
154
- */
155
- $('.wp-review-color').wpColorPicker();
156
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  });
1
+ /*
2
+ * Plugin Name: WP Review
3
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4
+ * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5
+ * Author: MyThemesShop
6
+ * Author URI: http://mythemeshop.com/
7
+ */
8
+
9
+ jQuery(document).ready(function($) {
10
+
11
+ /**
12
+ * Repeatable field
13
+ */
14
+ $('#add-row').on('click', function(e) {
15
+ e.preventDefault();
16
+ var row = $('.empty-row.screen-reader-text').clone(true);
17
+ var input = row.find('input');
18
+ if (typeof input.data('name') !== 'undefined' && input.data('name')) input.prop('name', input.data('name'));
19
+ row.removeClass('empty-row screen-reader-text');
20
+ row.insertBefore('#wp-review-item tbody>tr:last');
21
+ row.find("[name='wp_review_item_star[]']").addClass('review-star');
22
+ $.review_total();
23
+ });
24
+
25
+ $('.remove-row').on('click', function(e) {
26
+ e.preventDefault();
27
+ $(this).parents('tr').remove();
28
+ $.review_total();
29
+ });
30
+
31
+ /**
32
+ * Toggle meta box
33
+ */
34
+ $('#wp-review-metabox-item').hide();
35
+ $('#wp-review-metabox-heading').hide();
36
+ $('#wp-review-metabox-desc').hide();
37
+ $('#wp-review-metabox-userReview').hide();
38
+ $('#wp_review_shortcode_hint_field').hide();
39
+ $('#wp_review_id_hint').hide();
40
+
41
+ $('#wp_review_type').on( 'change', function() {
42
+
43
+ $('#wp-review-metabox-item').toggle( $(this).val() != '' );
44
+ $('#wp-review-metabox-heading').toggle( $(this).val() != '' );
45
+ $('#wp-review-metabox-desc').toggle( $(this).val() != '' );
46
+ $('#wp-review-metabox-userReview').toggle( $(this).val() != '' );
47
+ $('#wp_review_id_hint').toggle( $(this).val() != '' );
48
+
49
+ if ( $(this).val() == 'point' ) {
50
+ $('.dynamic-text').text('Points (1-10)');
51
+ }
52
+
53
+ else if ( $(this).val() == 'star' ) {
54
+ $('.dynamic-text').text('Star (1-5)');
55
+ }
56
+
57
+ else if ( $(this).val() == 'percentage' ) {
58
+ $('.dynamic-text').text('Percentage (1-100)');
59
+ }
60
+
61
+ $.validate_review_value();
62
+
63
+ });
64
+
65
+ $('#wp_review_custom_colors').change(function(e) {
66
+ if ( $(this).is(':checked') ) {
67
+ $('.wp-review-color-options').show();
68
+ } else {
69
+ $('.wp-review-color-options').hide();
70
+ }
71
+ });
72
+ $('#wp_review_custom_location').change(function(e) {
73
+ if ( $(this).is(':checked') ) {
74
+ $('.wp-review-location-options').show();
75
+ } else {
76
+ $('.wp-review-location-options').hide();
77
+ }
78
+ });
79
+ $('#wp_review_custom_width').change(function(e) {
80
+ if ( $(this).is(':checked') ) {
81
+ $('.wp-review-width-options').show();
82
+ } else {
83
+ $('.wp-review-width-options').hide();
84
+ }
85
+ });
86
+
87
+ $('#wp-wp_review_desc-wrap').toggle(! $('#wp_review_hide_desc').is(':checked'));
88
+ $('#wp_review_hide_desc').change(function() {
89
+ $('#wp-wp_review_desc-wrap, #wp-review-desc-title').toggle(!$(this).is(':checked'));
90
+ });
91
+
92
+ if ( $('#wp_review_type option:selected').val() === 'star' ) {
93
+ $('#wp-review-metabox-item').show();
94
+ $('#wp-review-metabox-heading').show();
95
+ $('#wp-review-metabox-desc').show();
96
+ $('#wp-review-metabox-userReview').show();
97
+ }
98
+
99
+ if ( $('#wp_review_type option:selected').val() === 'point' ) {
100
+ $('.dynamic-text').text('Points (1-10)');
101
+ $('#wp-review-metabox-item').show();
102
+ $('#wp-review-metabox-heading').show();
103
+ $('#wp-review-metabox-desc').show();
104
+ $('#wp-review-metabox-userReview').show();
105
+ }
106
+
107
+ if ( $('#wp_review_type option:selected').val() === 'percentage' ) {
108
+ $('.dynamic-text').text('Percentage (1-100)');
109
+ $('#wp-review-metabox-item').show();
110
+ $('#wp-review-metabox-heading').show();
111
+ $('#wp-review-metabox-desc').show();
112
+ $('#wp-review-metabox-userReview').show();
113
+ }
114
+
115
+ if ( $('#wp_review_type option:selected').val() != '' ) {
116
+ $('#wp_review_id_hint').show();
117
+ }
118
+
119
+ $('#wp_review_location').on('change', function() {
120
+ $('#wp_review_shortcode_hint_field').toggle($(this).val() == 'custom');
121
+ });
122
+ $('#wp_review_shortcode_hint').click(function() {
123
+ $(this).select();
124
+ });
125
+ if ($('#wp_review_location').val() == 'custom') {
126
+ $('#wp_review_shortcode_hint_field').show();
127
+ }
128
+
129
+ /**
130
+ * Review total
131
+ */
132
+ $.extend({
133
+
134
+ review_total: function(){
135
+ $('.review-star').on( 'change', function () {
136
+
137
+ var sum = 0,
138
+ value = 0,
139
+ input = $('.review-star').length;
140
+
141
+ $('.review-star').each(function () {
142
+ value = Number($(this).val());
143
+ if (!isNaN(value)) sum += value / input;
144
+ });
145
+
146
+ $('.wp-review-total').val( Math.round(sum * 10) / 10 );
147
+
148
+ $.validate_review_value();
149
+
150
+ });
151
+
152
+ },
153
+
154
+ validate_review_value: function(){
155
+
156
+ var type = $('#wp_review_type'),
157
+ fields = $('input.review-star'),
158
+ minval = 0,
159
+ maxval = 999;
160
+
161
+ if ( type.val() == 'point' ) {
162
+ minval = 1;
163
+ maxval = 10;
164
+ } else if ( type.val() == 'star' ) {
165
+ minval = 1;
166
+ maxval = 5;
167
+ } else if ( type.val() == 'percentage' ) {
168
+ minval = 1;
169
+ maxval = 100;
170
+ }
171
+
172
+ fields.each(function () {
173
+ var value = Number($(this).val());
174
+ if ( (value) && (value<minval || value>maxval) )
175
+ $(this).addClass('review-value-incorrect');
176
+ else
177
+ $(this).removeClass('review-value-incorrect');
178
+ });
179
+
180
+ },
181
+
182
+ });
183
+
184
+ $.review_total();
185
+ //$.validate_review_value();
186
+ //$('.review-star').trigger('change');
187
+
188
+ /**
189
+ * Color picker setup
190
+ */
191
+ $('.wp-review-color').wpColorPicker();
192
+
193
+ $('.wp-review-theme-defaults-msg .close-notice').click(function() {
194
+ $('.wp-review-theme-defaults-msg').remove();
195
+ });
196
+ $('.wp-review-theme-defaults-msg a.button').click(function() {
197
+ return confirm('Are you sure? This may override the current settings.');
198
+ });
199
+
200
  });
assets/js/main.js CHANGED
@@ -1,45 +1,52 @@
1
- /*-----------------------------------
2
- /* WP Review Plugin by MyThemeShop
3
- /* mythemeshop.com
4
- /*----------------------------------*/
5
-
6
- jQuery(document).ready(function($){
7
- $('.review-total-star.allowed-to-rate.has-not-rated-yet a').hover(function(){
8
- $(this).addClass( "hovered" ).prevAll().addClass( "hovered" );
9
- $('#mts-review-user-rate').val($(this).attr('data-input-value'));
10
- },
11
- function(){
12
- $(this).removeClass( "hovered" ).prevAll().removeClass( "hovered" );
13
- $('#mts-review-user-rate').val('');
14
- });
15
-
16
- $('.review-total-star.allowed-to-rate.has-not-rated-yet a').on('click', function(){
17
- $('.review-total-star.allowed-to-rate .review-result-wrapper').hide();
18
- $('.mts-review-wait-msg').show();
19
- var blogID = $('#blog_id').val();
20
- var token = $('#token').val();
21
- var post_id = $('#post_id').val();
22
- var user_id = $('#user_id').val();
23
- var review = $(this).attr('data-input-value');
24
- $.ajax ({
25
- data: {action: 'mts_review_get_review', post_id: post_id, user_id: user_id, nonce: token, review: review},
26
- type: 'post',
27
- url: ajaxurl,
28
- success: function( response ){
29
- if( response != 'MTS_REVIEW_DB_ERROR' ){
30
- response = response.split('|');
31
- $('#mts-user-reviews-total').html(response[0]);
32
- $('#mts-user-reviews-counter').html(response[1]);
33
- $('.mts-review-wait-msg').hide();
34
- $('.review-total-star.allowed-to-rate .review-result-wrapper').show();
35
- $('.review-total-star.allowed-to-rate').removeClass('has-not-rated-yet');
36
- $('.review-total-star.allowed-to-rate a, .review-total-star.allowed-to-rate a').off();
37
- $('.review-total-wrapper span.review-total-box.hidden').removeClass('hidden').show();
38
- var starsWidth = response[0] *20;
39
- $('.review-total-star .review-result').css('width', starsWidth+'%');
40
- }
41
- }
42
- });
43
-
44
- });
 
 
 
 
 
 
 
45
  });
1
+ /*
2
+ * Plugin Name: WP Review
3
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4
+ * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5
+ * Author: MyThemesShop
6
+ * Author URI: http://mythemeshop.com/
7
+ */
8
+
9
+ jQuery(document).ready(function($){
10
+ $('.review-total-star.allowed-to-rate.has-not-rated-yet a').hover(function(){
11
+ $(this).addClass( "hovered" ).prevAll().addClass( "hovered" );
12
+ $('#mts-review-user-rate').val($(this).attr('data-input-value'));
13
+ },
14
+ function(){
15
+ $(this).removeClass( "hovered" ).prevAll().removeClass( "hovered" );
16
+ $('#mts-review-user-rate').val('');
17
+ });
18
+
19
+ $('.review-total-star.allowed-to-rate.has-not-rated-yet a').on('click', function(){
20
+ $('.review-total-star.allowed-to-rate .review-result-wrapper').hide();
21
+ $('.mts-review-wait-msg').show();
22
+ var blogID = $('#blog_id').val();
23
+ var token = $('#token').val();
24
+ var post_id = $('#post_id').val();
25
+ var user_id = $('#user_id').val();
26
+ var review = $(this).attr('data-input-value');
27
+ $.ajax ({
28
+ data: {action: 'mts_review_get_review', post_id: post_id, user_id: user_id, nonce: token, review: review},
29
+ type: 'post',
30
+ url: ajaxurl,
31
+ success: function( response ){
32
+ if( response != 'MTS_REVIEW_DB_ERROR' ){
33
+ response = response.split('|');
34
+ $('#mts-user-reviews-total').html(response[0]);
35
+ $('#mts-user-reviews-counter').html(response[1]);
36
+ $('.mts-review-wait-msg').hide();
37
+ $('.review-total-star.allowed-to-rate .review-result-wrapper').show();
38
+ $('.review-total-star.allowed-to-rate').removeClass('has-not-rated-yet');
39
+ $('.review-total-star.allowed-to-rate a, .review-total-star.allowed-to-rate a').off();
40
+ $('.review-total-wrapper span.review-total-box.hidden').removeClass('hidden').show();
41
+ var starsWidth = response[0] *20;
42
+ $('.review-total-star .review-result').css('width', starsWidth+'%');
43
+
44
+ $('.wp-review-comment-field.allowed-to-rate').removeClass('allowed-to-rate').find('.review-result').css('width', starsWidth+'%');
45
+ }
46
+ }
47
+ });
48
+
49
+ });
50
+
51
+
52
  });
assets/js/wp-review-tab-widget-admin.js CHANGED
File without changes
assets/js/wp-review-tab-widget.js CHANGED
@@ -1,68 +1,71 @@
1
- /*-----------------------------------
2
- /* WP Review Plugin by MyThemeShop
3
- /* mythemeshop.com
4
- /*----------------------------------*/
5
-
6
- function wp_review_tab_loadTabContent(tab_name, page_num, container, args_obj) {
7
-
8
- var container = jQuery(container);
9
- var tab_content = container.find('#'+tab_name+'-tab-content');
10
-
11
- // only load content if it wasn't already loaded
12
- var isLoaded = tab_content.data('loaded');
13
-
14
- if (!isLoaded || page_num != 1) {
15
- if (!container.hasClass('wp-review-tab-loading')) {
16
- container.addClass('wp-review-tab-loading');
17
-
18
- tab_content.load(wp_review_tab.ajax_url, {
19
- action: 'wp_review_tab_widget_content',
20
- tab: tab_name,
21
- page: page_num,
22
- args: args_obj
23
- }, function() {
24
- container.removeClass('wp-review-tab-loading');
25
- tab_content.data('loaded', 1).hide().fadeIn().siblings().hide();
26
- }
27
- );
28
- }
29
- } else {
30
- tab_content.fadeIn().siblings().hide();
31
- }
32
- }
33
-
34
- jQuery(document).ready(function() {
35
- jQuery('.wp_review_tab_widget_content').each(function() {
36
- var $this = jQuery(this);
37
- var widget_id = this.id;
38
- var args = $this.data('args');
39
-
40
- // load tab content on click
41
- $this.find('.wp-review-tabs a').click(function(e) {
42
- e.preventDefault();
43
- jQuery(this).parent().addClass('selected').siblings().removeClass('selected');
44
- var tab_name = this.id.slice(0, -4); // -tab
45
- wp_review_tab_loadTabContent(tab_name, 1, $this, args);
46
- });
47
-
48
- // pagination
49
- $this.on('click', '.wp-review-tab-pagination a', function(e) {
50
- e.preventDefault();
51
- var $this_a = jQuery(this);
52
- var tab_name = $this_a.closest('.tab-content').attr('id').slice(0, -12); // -tab-content
53
- var page_num = parseInt($this_a.closest('.tab-content').children('.page_num').val());
54
-
55
- if ($this_a.hasClass('next')) {
56
- wp_review_tab_loadTabContent(tab_name, page_num + 1, $this, args);
57
- } else {
58
- $this.find('#'+tab_name+'-tab-content').data('loaded', 0);
59
- wp_review_tab_loadTabContent(tab_name, page_num - 1, $this, args);
60
- }
61
-
62
- });
63
-
64
- // load first tab now
65
- $this.find('.wp-review-tabs a').first().click();
66
- });
67
-
 
 
 
68
  });
1
+ /*
2
+ * Plugin Name: WP Review
3
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
4
+ * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
5
+ * Author: MyThemesShop
6
+ * Author URI: http://mythemeshop.com/
7
+ */
8
+
9
+ function wp_review_tab_loadTabContent(tab_name, page_num, container, args_obj) {
10
+
11
+ var container = jQuery(container);
12
+ var tab_content = container.find('#'+tab_name+'-tab-content');
13
+
14
+ // only load content if it wasn't already loaded
15
+ var isLoaded = tab_content.data('loaded');
16
+
17
+ if (!isLoaded || page_num != 1) {
18
+ if (!container.hasClass('wp-review-tab-loading')) {
19
+ container.addClass('wp-review-tab-loading');
20
+
21
+ tab_content.load(wp_review_tab.ajax_url, {
22
+ action: 'wp_review_tab_widget_content',
23
+ tab: tab_name,
24
+ page: page_num,
25
+ args: args_obj
26
+ }, function() {
27
+ container.removeClass('wp-review-tab-loading');
28
+ tab_content.data('loaded', 1).hide().fadeIn().siblings().hide();
29
+ }
30
+ );
31
+ }
32
+ } else {
33
+ tab_content.fadeIn().siblings().hide();
34
+ }
35
+ }
36
+
37
+ jQuery(document).ready(function() {
38
+ jQuery('.wp_review_tab_widget_content').each(function() {
39
+ var $this = jQuery(this);
40
+ var widget_id = this.id;
41
+ var args = $this.data('args');
42
+
43
+ // load tab content on click
44
+ $this.find('.wp-review-tabs a').click(function(e) {
45
+ e.preventDefault();
46
+ jQuery(this).parent().addClass('selected').siblings().removeClass('selected');
47
+ var tab_name = this.id.slice(0, -4); // -tab
48
+ wp_review_tab_loadTabContent(tab_name, 1, $this, args);
49
+ });
50
+
51
+ // pagination
52
+ $this.on('click', '.wp-review-tab-pagination a', function(e) {
53
+ e.preventDefault();
54
+ var $this_a = jQuery(this);
55
+ var tab_name = $this_a.closest('.tab-content').attr('id').slice(0, -12); // -tab-content
56
+ var page_num = parseInt($this_a.closest('.tab-content').children('.page_num').val());
57
+
58
+ if ($this_a.hasClass('next')) {
59
+ wp_review_tab_loadTabContent(tab_name, page_num + 1, $this, args);
60
+ } else {
61
+ $this.find('#'+tab_name+'-tab-content').data('loaded', 0);
62
+ wp_review_tab_loadTabContent(tab_name, page_num - 1, $this, args);
63
+ }
64
+
65
+ });
66
+
67
+ // load first tab now
68
+ $this.find('.wp-review-tabs a').first().click();
69
+ });
70
+
71
  });
filter-list.php CHANGED
@@ -5,44 +5,24 @@ You can use these filterns in your theme in funtions.php file
5
  and set different default settings.
6
  */
7
 
8
- // Set default colors for new reviews
9
- function new_default_review_colors($colors) {
10
- $colors = array(
11
- 'color' => '#1E73BE',
12
- 'fontcolor' => '#555',
13
- 'bgcolor1' => '#E7E7E7',
14
- 'bgcolor2' => '#fff',
15
- 'bordercolor' => '#e7e7e7'
16
- );
17
- return $colors;
18
- }
19
- add_filter( 'wp_review_default_colors', 'new_default_review_colors' );
20
-
21
- // Set colors for ALL displayed reviews
22
  function mts_new_review_colors($colors, $id) {
23
  $colors['bgcolor1'] = '#ff0000';
24
  return $colors;
25
  }
26
  add_filter( 'wp_review_colors', 'mts_new_review_colors', 10, 2 );
27
 
28
- // Set location for ALL displayed reviews
29
  function mts_new_review_location($position, $id) {
30
  $position = 'bottom';
31
  return $position;
32
  }
33
  add_filter( 'wp_review_location', 'mts_new_review_location', 10, 2 );
34
-
35
- // Set default location for new reviews
36
- function mts_new_default_review_location($position) {
37
- $position = 'bottom';
38
- return $position;
39
- }
40
- add_filter( 'wp_review_default_location', 'mts_new_default_review_location' );
41
-
42
  // Hide fields in "item" meta box
43
  function mts_hide_item_metabox_fields($fields) {
44
  unset($fields['location'], $fields['fontcolor'], $fields['bordercolor']);
45
- // Or remove all with:
46
  // $fields = array();
47
  return $fields;
48
  }
@@ -80,4 +60,18 @@ function mts_wp_review_exclude_post_types($excluded) {
80
  return $excluded;
81
  }
82
  add_filter( 'wp_review_excluded_post_types', 'mts_wp_review_exclude_post_types' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  ?>
5
  and set different default settings.
6
  */
7
 
8
+ // Set colors for selected or all reviews
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  function mts_new_review_colors($colors, $id) {
10
  $colors['bgcolor1'] = '#ff0000';
11
  return $colors;
12
  }
13
  add_filter( 'wp_review_colors', 'mts_new_review_colors', 10, 2 );
14
 
15
+ // Set location for selected or all reviews
16
  function mts_new_review_location($position, $id) {
17
  $position = 'bottom';
18
  return $position;
19
  }
20
  add_filter( 'wp_review_location', 'mts_new_review_location', 10, 2 );
21
+
 
 
 
 
 
 
 
22
  // Hide fields in "item" meta box
23
  function mts_hide_item_metabox_fields($fields) {
24
  unset($fields['location'], $fields['fontcolor'], $fields['bordercolor']);
25
+ // Or remove all (except features which can't be removed) with:
26
  // $fields = array();
27
  return $fields;
28
  }
60
  return $excluded;
61
  }
62
  add_filter( 'wp_review_excluded_post_types', 'mts_wp_review_exclude_post_types' );
63
+
64
+ // Set the review options in your theme
65
+ // These will be set as the global options for the plugin upon theme activation
66
+ $new_options = array(
67
+ 'colors' => array(
68
+ 'color' => '#dd3333',
69
+ 'fontcolor' => '#555555',
70
+ 'bgcolor1' => '#e7e7e7',
71
+ 'bgcolor2' => '#ffffff',
72
+ 'bordercolor' => '#e7e7e7'
73
+ )
74
+ );
75
+ if ( function_exists( 'wp_review_theme_defaults' )) wp_review_theme_defaults( $new_options );
76
+
77
  ?>
includes/enqueue.php CHANGED
@@ -26,8 +26,8 @@ function wp_review_enqueue() {
26
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
27
 
28
  if ( $type != '' ){
29
- wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.0', 'all' );
30
- wp_enqueue_script( 'wp_review-js', trailingslashit( WP_REVIEW_ASSETS ) . 'js/main.js', array(), '1.0', 'all' );
31
  ?>
32
  <script type="text/javascript">
33
  var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
26
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
27
 
28
  if ( $type != '' ){
29
+ wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.1', 'all' );
30
+ wp_enqueue_script( 'wp_review-js', trailingslashit( WP_REVIEW_ASSETS ) . 'js/main.js', array(), '1.1', 'all' );
31
  ?>
32
  <script type="text/javascript">
33
  var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
includes/functions.php CHANGED
@@ -9,12 +9,11 @@ ob_start();
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');
@@ -22,6 +21,9 @@ add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review');
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 );
@@ -36,14 +38,34 @@ add_image_size( 'wp_review_small', 65, 65, true );
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 = '';
@@ -57,7 +79,7 @@ function wp_review_get_data() {
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
 
@@ -66,9 +88,9 @@ function wp_review_get_data() {
66
  * make sure the hook only apply on allowed post types
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 != '' ){
@@ -92,7 +114,7 @@ function wp_review_get_data() {
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';
@@ -101,10 +123,10 @@ function wp_review_get_data() {
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','mts-review').'</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
 
@@ -125,8 +147,8 @@ function wp_review_get_data() {
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','mts-review').'</div>';
129
- } else {
130
  $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '</div>';
131
  }
132
 
@@ -139,9 +161,10 @@ function wp_review_get_data() {
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
 
@@ -152,12 +175,10 @@ function wp_review_get_data() {
152
  if ( 'percentage' == $type ) {
153
  $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
154
  } elseif ( 'point' == $type ) {
155
- $review .= '<span class="review-total-box" itemprop="review">' . $total . '/'.__('10','mts-review').'</span></span>';
156
- } else {
157
- $review .= '<span class="review-total-box" itemprop="review">' . $total . '</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>';
@@ -173,7 +194,7 @@ function wp_review_get_data() {
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>';
@@ -191,6 +212,7 @@ function wp_review_get_data() {
191
  </span>
192
  </div>';
193
  }
 
194
 
195
  /**
196
  * USERS REVIEW AREA
@@ -205,7 +227,7 @@ function wp_review_get_data() {
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'];
@@ -225,15 +247,15 @@ function wp_review_get_data() {
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>';
@@ -267,7 +289,8 @@ function wp_review_get_data() {
267
  $review .= '</div><!-- #review -->';
268
 
269
  $review = apply_filters('wp_review_get_data', $review, $post->ID, $type, $total, $items);
270
- return $review;
 
271
  } else {
272
  return '';
273
  }
@@ -275,8 +298,15 @@ function wp_review_get_data() {
275
 
276
  function wp_review_inject_data( $content ) {
277
  global $post;
 
 
278
  $location = get_post_meta( $post->ID, 'wp_review_location', true );
279
- $location = apply_filters('wp_review_location', $location, $post->ID);
 
 
 
 
 
280
  if (empty($location) || $location == 'custom') {
281
  return $content;
282
  }
@@ -308,20 +338,40 @@ function wp_review_inject_data( $content ) {
308
  */
309
  function wp_review_show_total($echo = true, $class = 'review-total-only') {
310
  global $post;
 
311
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
312
  $total = get_post_meta( $post->ID, 'wp_review_total', true );
313
  $review = '';
314
 
315
- if (!empty($type) && !empty($total)) {
316
- wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.0', 'all' );
317
-
318
- $review = '<div class="review-type-'.$type.' '.esc_attr($class).'"> ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
 
320
  if ( 'percentage' == $type ) {
321
- $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
322
  } elseif ( 'point' == $type ) {
323
- $review .= '<span class="review-total-box" itemprop="review">' . $total . '/'.__('10','mts-review').'</span></span>';
324
- } else {
325
  // star
326
  $review .= '<div class="review-total-star">';
327
  $review .= '<div class="review-result-wrapper">';
@@ -342,6 +392,10 @@ function wp_review_show_total($echo = true, $class = 'review-total-only') {
342
  }
343
 
344
  $review .= '</div>';
 
 
 
 
345
  }
346
 
347
  $review = apply_filters('wp_review_show_total', $review, $post->ID, $type, $total);
@@ -377,10 +431,16 @@ function mts_get_post_reviews( $post_id ){
377
  */
378
  function wp_review_color_output() {
379
  global $post;
380
-
 
 
381
  /* Retrieve the meta box data. */
382
  if(is_singular()) {
383
  $colors = array();
 
 
 
 
384
  $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
385
  $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
386
  $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
@@ -389,50 +449,51 @@ function wp_review_color_output() {
389
  $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
390
  $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
391
 
392
- // Filter for changing colors
393
- // Post ID gets passed as well
394
- // Usage:
395
- // add_filter( 'wp_review_colors', $function_to_add, 10, 2 );
396
  $colors = apply_filters('wp_review_colors', $colors, $post->ID);
 
397
  extract($colors, EXTR_SKIP);
398
-
399
  if( !$color ) $color = '#333333';
400
 
401
- if( $color ) {
402
- echo '<style type="text/css">';
403
 
404
- if ( 'star' == $type ) { ?>
405
 
406
- .review-result-wrapper .review-result i { color: <?php echo $color; ?>; opacity: 1; filter: alpha(opacity=100); }
407
- .review-result-wrapper i{ color: <?php echo $color; ?>; opacity: 0.50; filter: alpha(opacity=50); }
408
 
409
- <?php } elseif ( 'point' == $type ) { ?>
410
-
411
- .bar-point .review-result { background-color: <?php echo $color; ?>; }
412
-
413
- <?php } else { ?>
414
-
415
- .percentage-point .review-result { background-color: <?php echo $color; ?>; }
416
-
417
- <?php }
418
- ?>
419
- .review-wrapper, .review-title, .review-desc p{ color: <?php echo $fontcolor; ?>;}
420
- .review-list li, .review-wrapper{ background: <?php echo $bgcolor2; ?>;}
421
- .review-title, .review-list li:nth-child(2n){background: <?php echo $bgcolor1; ?>;}
422
-
423
- .bar-point .allowed-to-rate .review-result, .percentage-point .allowed-to-rate .review-result{background: none;}
424
- .review-total-star.allowed-to-rate a i { color: <?php echo $color; ?>; opacity: 0.50; filter: alpha(opacity=50); }
425
- .bar-point .allowed-to-rate .review-result, .percentage-point .allowed-to-rate .review-result{text-indent:0;}
426
- .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); }
427
- .review-wrapper, .review-title, .review-list li, .review-list li:last-child, .user-review-area{border-color: <?php echo $bordercolor; ?>;}
428
- <?php
429
- if( $total == '' ){?>
430
- .user-review-area{border: 1px solid <?php echo $bordercolor; ?>; margin-top: 0px;}
431
- .review-desc{width: 100%;}
432
- .review-wrapper{border: none; overflow: visible;}
433
- <?php }
434
- echo '</style>';
435
  }
 
 
 
436
  }
437
  }
438
 
@@ -458,6 +519,24 @@ function hasPreviousReview( $post_id, $user_id, $ip ){
458
  return false;
459
  }
460
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
  /**
463
  *Get review with Ajax
@@ -499,4 +578,33 @@ function mts_review_get_review(){
499
  exit;
500
  }
501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  ?>
9
  * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
  */
11
 
12
+ $options = get_option('wp_review_options');
13
+
14
  /* Display the meta box data below 'the_content' hook. */
15
  add_filter( 'the_content', 'wp_review_inject_data' );
16
 
 
 
 
17
  /* Get review with Ajax */
18
  add_action('wp_ajax_mts_review_get_review', 'mts_review_get_review');
19
  add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review');
21
  /* Show with shortcode */
22
  add_shortcode('wp-review', 'wp_review_get_data');
23
  add_shortcode('wp-review-total', 'wp_review_total_shortcode');
24
+ // aliases
25
+ add_shortcode('wp_review', 'wp_review_get_data');
26
+ add_shortcode('wp_review_total', 'wp_review_total_shortcode');
27
 
28
  // image sizes for the widgets
29
  add_image_size( 'wp_review_large', 320, 200, true );
38
  function wp_review_get_data() {
39
  global $post;
40
  global $blog_id;
41
+ $options = get_option('wp_review_options');
42
 
43
  /* Retrieve the meta box data. */
44
  $heading = get_post_meta( $post->ID, 'wp_review_heading', true );
45
+ $desc_title = get_post_meta( $post->ID, 'wp_review_desc_title', true );
46
+ if ( ! $desc_title ) $desc_title = __('Summary', 'wp-review');
47
  $desc = get_post_meta( $post->ID, 'wp_review_desc', true );
48
  $items = get_post_meta( $post->ID, 'wp_review_item', true );
49
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
50
  $total = get_post_meta( $post->ID, 'wp_review_total', true );
51
+ $hide_desc = get_post_meta( $post->ID, 'wp_review_hide_desc', true );
52
  $allowUsers = get_post_meta( $post->ID, 'wp_review_userReview', true );
53
+
54
+ $colors = array();
55
+ $colors['custom_colors'] = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
56
+ $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
57
+ $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
58
+ $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
59
+ $colors['bgcolor1'] = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
60
+ $colors['bgcolor2'] = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
61
+ $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
62
+ $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
63
+
64
+ if (!$colors['custom_colors']) {
65
+ $colors = array_merge($colors, $options['colors']);
66
+ }
67
+ $colors = apply_filters('wp_review_colors', $colors, $post->ID);
68
+ $color = $colors['color'];
69
 
70
  /* Define a custom class for bar type. */
71
  $class = '';
79
  $allowed_post_types = array();
80
  foreach ($post_types as $i => $post_type) {
81
  if (!in_array($post_type, $excluded_post_types)) {
82
+ $allowed_post_types[] = $post_type; // allow it if it's not excluded
83
  }
84
  }
85
 
88
  * make sure the hook only apply on allowed post types
89
  */
90
  if ( $type != '' && is_singular($allowed_post_types) && is_main_query() ) {
91
+ //if ( $type != '' && is_main_query() && in_array(get_post_type($post->ID), $allowed_post_types)) {
92
+ // using this second if() instead of the first will allow reviews to be displayed on archive pages, but it may mess up excerpts
93
+ $review = '<div id="review" class="review-wrapper wp-review-'.$post->ID.' ' . $class . ' delay-animation" >';
94
 
95
  /* Review title. */
96
  if( $heading != '' ){
114
  $result = $item['wp_review_item_star'] * 10;
115
  $bestresult = '<meta itemprop="best" content="10"/>';
116
  $best = '10';
117
+ } else { // percentage
118
  $result = $item['wp_review_item_star'] * 100 / 100;
119
  $bestresult = '<meta itemprop="best" content="100"/>';
120
  $best = '100';
123
  $review .= '<li>';
124
 
125
  if ( 'point' == $type ) {
126
+ $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . ' - <span>' . $item['wp_review_item_star'] . '/10</span></span>';
127
  } elseif( 'percentage' == $type ) {
128
+ $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . ' - <span>' . $item['wp_review_item_star'] . '%' . '</span></span>';
129
+ } elseif ( 'star' == $type ) {
130
  $review .= '<span>' . wp_kses_post( $item['wp_review_item_title'] ) . '</span>';
131
  }
132
 
147
  $review .= '<i class="mts-icon-star"></i>';
148
  $review .= '</div><!-- .review-result -->';
149
  } elseif ( 'point' == $type ) {
150
+ $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '/10</div>';
151
+ } elseif ( 'percentage' == $type ) {
152
  $review .= '<div class="review-result" style="width:' . $result . '%;">' . $item['wp_review_item_star'] . '</div>';
153
  }
154
 
161
  }
162
 
163
  /* Review description. */
164
+ if ( ! $hide_desc ) {
165
  if ( $desc ) {
166
  $review .= '<div class="review-desc" >';
167
+ $review .= '<p class="review-summary-title"><strong>' . $desc_title . '</strong></p>';
168
  $review .= do_shortcode ( shortcode_unautop( wp_kses_post( wpautop( $desc ) ) ) );
169
  $review .= '</div><!-- .review-desc -->';
170
 
175
  if ( 'percentage' == $type ) {
176
  $review .= '<span class="review-total-box"><span itemprop="review">' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
177
  } elseif ( 'point' == $type ) {
178
+ $review .= '<span class="review-total-box" itemprop="review">' . $total . '/10</span>';
179
+ } elseif ( 'star' == $type ) {
180
+ $review .= '<span class="review-total-box" itemprop="review">' . $total . '</span>';
 
181
 
 
182
  $review .= '<div class="review-total-star">';
183
  $review .= '<div class="review-result-wrapper">';
184
  $review .= '<i class="mts-icon-star"></i>';
194
  $review .= '<i class="mts-icon-star"></i>';
195
  $review .= '</div><!-- .review-result -->';
196
  $review .= '</div><!-- .review-result-wrapper -->';
197
+ $review .= '</div><!-- .review-star -->';
198
  }
199
 
200
  $review .= '</div>';
212
  </span>
213
  </div>';
214
  }
215
+ }
216
 
217
  /**
218
  * USERS REVIEW AREA
227
 
228
  $review .= '<div style="clear: both;"></div>';
229
 
230
+ $review .= '<div class="user-review-area" title="'.__('Click on the stars to rate!', 'wp-review').'">';
231
  //$ip = $_SERVER['REMOTE_ADDR'];
232
  if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
233
  $ip = $_SERVER['HTTP_CLIENT_IP'];
247
 
248
 
249
  if( $userTotal == '' ) $userTotal = '0.0';
250
+ $review .= '<div class="user-total-wrapper"><span class="user-review-title">'.__('User Rating','wp-review').': </span><span class="review-total-box"><span id="mts-user-reviews-total">' . $userTotal . '</span> ';
251
+ $review.= '<small>(<span id="mts-user-reviews-counter" >'.$usersReviewsCount.'</span> '.__('votes', 'wp-review').')</small></span></div>';
252
 
253
  if( hasPreviousReview( $post->ID, $user_id, $ip )) {
254
  $hasNotRatedClass = '';
255
  }
256
 
257
  $review .= '<div class="review-total-star '.$allowedClass.' '.$hasNotRatedClass.'" >';
258
+ $review .='<div class="mts-review-wait-msg"><span class="animate-spin mts-icon-loader"></span>'.__('Sending','wp-review').'</div>';
259
  $review .= '<div class="review-result-wrapper">';
260
  $review .= '<a data-input-value="1" title="1/5"><i class="mts-icon-star"></i></a>';
261
  $review .= '<a data-input-value="2" title="2/5"><i class="mts-icon-star"></i></a>';
289
  $review .= '</div><!-- #review -->';
290
 
291
  $review = apply_filters('wp_review_get_data', $review, $post->ID, $type, $total, $items);
292
+
293
+ return $review . wp_review_color_output(); // add color CSS to output
294
  } else {
295
  return '';
296
  }
298
 
299
  function wp_review_inject_data( $content ) {
300
  global $post;
301
+ $options = get_option('wp_review_options');
302
+ $custom_location = get_post_meta( $post->ID, 'wp_review_custom_location', true );
303
  $location = get_post_meta( $post->ID, 'wp_review_location', true );
304
+ if (!$custom_location && !empty($options['review_location'])) {
305
+ $location = $options['review_location'];
306
+ }
307
+
308
+ $location = apply_filters('wp_review_location', $location, $post->ID);
309
+
310
  if (empty($location) || $location == 'custom') {
311
  return $content;
312
  }
338
  */
339
  function wp_review_show_total($echo = true, $class = 'review-total-only') {
340
  global $post;
341
+
342
  $type = get_post_meta( $post->ID, 'wp_review_type', true );
343
  $total = get_post_meta( $post->ID, 'wp_review_total', true );
344
  $review = '';
345
 
346
+ $options = get_option('wp_review_options');
347
+ $colors = array();
348
+ $colors['custom_location'] = get_post_meta( $post->ID, 'wp_review_custom_location', true );
349
+ $colors['custom_colors'] = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
350
+ $colors['custom_width'] = get_post_meta( $post->ID, 'wp_review_custom_width', true );
351
+
352
+ $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
353
+ $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
354
+ $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
355
+ $colors['bgcolor1'] = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
356
+ $colors['bgcolor2'] = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
357
+ $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
358
+ $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
359
+
360
+ if (!$colors['custom_colors']) {
361
+ $colors = array_merge($colors, $options['colors']);
362
+ }
363
+ $colors = apply_filters('wp_review_colors', $colors, $post->ID);
364
+
365
+ if (!empty($type) && (!empty($total) || $total === '0')) {
366
+ wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), '1.1', 'all' );
367
+
368
+ $review = '<div class="review-type-'.$type.' '.esc_attr($class).' wp-review-show-total wp-review-total-'.$post->ID.'"> ';
369
 
370
  if ( 'percentage' == $type ) {
371
+ $review .= '<span class="review-total-box"><span>' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
372
  } elseif ( 'point' == $type ) {
373
+ $review .= '<span class="review-total-box">' . $total . '/'.__('10','wp-review').'</span></span>';
374
+ } elseif ( 'star' == $type ) {
375
  // star
376
  $review .= '<div class="review-total-star">';
377
  $review .= '<div class="review-result-wrapper">';
392
  }
393
 
394
  $review .= '</div>';
395
+
396
+ $review .= '<style type="text/css">';
397
+ $review .= '.wp-review-total-'.$post->ID.' i, .wp-review-total-'.$post->ID.' .review-total-box { color: '.$colors['color'].' }';
398
+ $review .= '</style>';
399
  }
400
 
401
  $review = apply_filters('wp_review_show_total', $review, $post->ID, $type, $total);
431
  */
432
  function wp_review_color_output() {
433
  global $post;
434
+ $style = '';
435
+ $options = get_option('wp_review_options');
436
+ if (empty($options['colors'])) $options['colors'] = array();
437
  /* Retrieve the meta box data. */
438
  if(is_singular()) {
439
  $colors = array();
440
+ $colors['custom_location'] = get_post_meta( $post->ID, 'wp_review_custom_location', true );
441
+ $colors['custom_colors'] = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
442
+ $colors['custom_width'] = get_post_meta( $post->ID, 'wp_review_custom_width', true );
443
+
444
  $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
445
  $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
446
  $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
449
  $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
450
  $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
451
 
452
+ if (!$colors['custom_colors']) {
453
+ $colors = array_merge($colors, $options['colors']);
454
+ }
 
455
  $colors = apply_filters('wp_review_colors', $colors, $post->ID);
456
+
457
  extract($colors, EXTR_SKIP);
458
+
459
  if( !$color ) $color = '#333333';
460
 
461
+ $style = '<style type="text/css">';
 
462
 
463
+ if ( 'star' == $type ) {
464
 
465
+ $style .= '.wp-review-'.$post->ID.' .review-result-wrapper .review-result i { color: '.$color.'; opacity: 1; filter: alpha(opacity=100); }
466
+ .wp-review-'.$post->ID.' .review-result-wrapper i{ color: '.$color.'; opacity: 0.50; filter: alpha(opacity=50); }';
467
 
468
+ } elseif ( 'point' == $type ) {
469
+
470
+ $style .= '.wp-review-'.$post->ID.'.bar-point .review-result { background-color: '.$color.'; }';
471
+
472
+ } elseif ( 'percentage' == $type ) {
473
+
474
+ $style .= '.wp-review-'.$post->ID.'.percentage-point .review-result { background-color: '.$color.'; }';
475
+
476
+ }
477
+
478
+ $style .= '.wp-review-'.$post->ID.'.review-wrapper, .wp-review-'.$post->ID.' .review-title, .wp-review-'.$post->ID.' .review-desc p{ color: '.$fontcolor.';}
479
+ .wp-review-'.$post->ID.' .review-list li, .wp-review-'.$post->ID.'.review-wrapper{ background: '.$bgcolor2.';}
480
+ .wp-review-'.$post->ID.' .review-title, .wp-review-'.$post->ID.' .review-list li:nth-child(2n){background: '.$bgcolor1.';}
481
+
482
+ .wp-review-'.$post->ID.'.bar-point .allowed-to-rate .review-result, .wp-review-'.$post->ID.'.percentage-point .allowed-to-rate .review-result{background: none;}
483
+ .wp-review-'.$post->ID.' .review-total-star.allowed-to-rate a i, .wp-review-comment-field a i, .wp-review-comment-rating a i { color: '.$color.'; opacity: 0.50; filter: alpha(opacity=50); }
484
+ .wp-review-'.$post->ID.'.bar-point .allowed-to-rate .review-result, .wp-review-'.$post->ID.'.percentage-point .allowed-to-rate .review-result{text-indent:0;}
485
+ .wp-review-'.$post->ID.'.bar-point .allowed-to-rate .review-result i, .wp-review-'.$post->ID.'.percentage-point .allowed-to-rate .review-result i, .wp-review-'.$post->ID.' .mts-user-review-star-container .selected i, .wp-review-'.$post->ID.' .user-review-area .review-result i, .wp-review-comment-field .review-result i, .wp-review-comment-rating .review-result i { color: '.$color.'; opacity: 1; filter: alpha(opacity=100); }
486
+ .wp-review-'.$post->ID.'.review-wrapper, .wp-review-'.$post->ID.' .review-title, .wp-review-'.$post->ID.' .review-list li, .wp-review-'.$post->ID.' .review-list li:last-child, .wp-review-'.$post->ID.' .user-review-area{border-color: '.$bordercolor.';}';
487
+
488
+ if( $total == '' ){
489
+
490
+ $style .= '.wp-review-'.$post->ID.' .user-review-area{border: 1px solid '.$bordercolor.'; margin-top: 0px;}
491
+ .wp-review-'.$post->ID.' .review-desc{width: 100%;}
492
+ .wp-review-'.$post->ID.'.review-wrapper{border: none; overflow: visible;}';
 
493
  }
494
+ $style .= '</style>';
495
+
496
+ return $style;
497
  }
498
  }
499
 
519
  return false;
520
  }
521
 
522
+ function getPreviousReview( $post_id, $user_id, $ip ) {
523
+ if( is_numeric( $post_id ) && $post_id > 0 ){
524
+ global $wpdb;
525
+ global $blog_id;
526
+ $table_name = $wpdb->prefix . MTS_WP_REVIEW_DB_TABLE;
527
+ if (function_exists('is_multisite') && is_multisite()) {$table_name = $wpdb->base_prefix . MTS_WP_REVIEW_DB_TABLE;}
528
+ if( is_numeric( $user_id ) && $user_id > 0 ){
529
+ $prevRates = $wpdb->get_row( $wpdb->prepare("SELECT rate FROM $table_name WHERE blog_id = '%d' AND post_id = '%d' AND user_id = '%d'", $blog_id, $post_id, $user_id) );
530
+ if( $prevRates->rate ) return $prevRates->rate; else return 0;
531
+ }
532
+ elseif( $ip != '' ){
533
+ $prevRates = $wpdb->get_row( $wpdb->prepare("SELECT rate FROM $table_name WHERE blog_id = '%d' AND post_id = '%d' AND user_ip = '%s' AND user_id = '0'", $blog_id, $post_id, $ip) );
534
+ if( $prevRates->rate ) return $prevRates->rate; else return 0;
535
+ }
536
+ else return false;
537
+ }
538
+ return false;
539
+ }
540
 
541
  /**
542
  *Get review with Ajax
578
  exit;
579
  }
580
 
581
+ function wp_review_theme_defaults($new_options, $force_change = false) {
582
+ global $pagenow;
583
+ $opt_name = 'wp_review_options_'.wp_get_theme();
584
+ $options = get_option('wp_review_options');
585
+ if (empty($options)) $options = array();
586
+ $options_updated = get_option( $opt_name );
587
+ // if the theme was just activated OR options weren't updated yet
588
+ if ( empty( $options_updated ) || $options_updated != $new_options || $force_change || ( isset( $_GET['activated'] ) && $pagenow == 'themes.php' )) {
589
+ update_option( 'wp_review_options', array_merge($options, $new_options) );
590
+ update_option( $opt_name, $new_options );
591
+ }
592
+ }
593
+
594
+ function wp_review_get_all_image_sizes() {
595
+ global $_wp_additional_image_sizes;
596
+
597
+ $default_image_sizes = array( 'thumbnail', 'medium', 'large' );
598
+
599
+ foreach ( $default_image_sizes as $size ) {
600
+ $image_sizes[$size]['width'] = intval( get_option( "{$size}_size_w") );
601
+ $image_sizes[$size]['height'] = intval( get_option( "{$size}_size_h") );
602
+ $image_sizes[$size]['crop'] = get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false;
603
+ }
604
+
605
+ if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
606
+ $image_sizes = array_merge( $image_sizes, $_wp_additional_image_sizes );
607
+
608
+ return $image_sizes;
609
+ }
610
  ?>
includes/widget.php CHANGED
@@ -10,9 +10,9 @@ class wp_review_tab_widget extends WP_Widget {
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'));
@@ -45,24 +45,24 @@ class wp_review_tab_widget extends WP_Widget {
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>
@@ -70,46 +70,46 @@ class wp_review_tab_widget extends WP_Widget {
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 />
@@ -119,25 +119,25 @@ class wp_review_tab_widget extends WP_Widget {
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>
@@ -145,19 +145,19 @@ class wp_review_tab_widget extends WP_Widget {
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>
@@ -450,10 +450,10 @@ class wp_review_tab_widget extends WP_Widget {
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>
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.', 'wp-review'));
14
  $control_ops = array('width' => 200, 'height' => 350);
15
+ $this->WP_Widget('wp_review_tab_widget', __('WP Review Widget', 'wp-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'));
45
  extract($instance);
46
  ?>
47
  <div class="wp_review_tab_options_form">
48
+ <h4><?php _e('Select Tabs', 'wp-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', 'wp-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', 'wp-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', 'wp-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', 'wp-review'); ?>
66
  </label>
67
  </div>
68
  <div class="clear"></div>
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:', 'wp-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', 'wp-review'); ?></option>
76
+ <option value="star" <?php selected($review_type, 'star', true); ?>><?php _e('Star', 'wp-review'); ?></option>
77
+ <option value="point" <?php selected($review_type, 'point', true); ?>><?php _e('Point', 'wp-review'); ?></option>
78
+ <option value="percentage" <?php selected($review_type, 'percentage', true); ?>><?php _e('Percentage', 'wp-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', 'wp-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:', 'wp-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:', 'wp-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', 'wp-review'); ?></option>
100
+ <option value="large" <?php selected($thumb_size, 'large', true); ?>><?php _e('Large', 'wp-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', 'wp-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:', 'wp-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 />
119
 
120
  <div class="clear"></div>
121
 
122
+ <h4><a href="#" class="wp_review_tab_titles_header"><?php _e('Tab Titles', 'wp-review'); ?></a> | <a href="#" class="wp_review_tab_order_header"><?php _e('Tab Order', 'wp-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', 'wp-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', 'wp-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', 'wp-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', 'wp-review'); ?>
141
  </label>
142
  </div>
143
  <div class="clear" style="margin-bottom: 15px;"></div>
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', 'wp-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', 'wp-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', 'wp-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', 'wp-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>
450
  ?>
451
  <div class="wp-review-tab-pagination">
452
  <?php if ($page > 1) : ?>
453
+ <a href="#" class="previous"><span><?php _e('&laquo; Previous', 'wp-review'); ?></span></a>
454
  <?php endif; ?>
455
  <?php if ($page != $last_page) : ?>
456
+ <a href="#" class="next"><span><?php _e('Next &raquo;', 'wp-review'); ?></span></a>
457
  <?php endif; ?>
458
  </div>
459
  <div class="clear"></div>
languages/default.mo CHANGED
Binary file
languages/default.po CHANGED
@@ -3,7 +3,7 @@ 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"
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-09-06 19:26+0530\n"
7
  "Last-Translator: MyThemeShop <support-team@mythemeshop.com>\n"
8
  "Language-Team: MyThemeShop\n"
9
  "MIME-Version: 1.0\n"
license.txt CHANGED
File without changes
readme.txt CHANGED
@@ -1,14 +1,14 @@
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: 4.0
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
 
@@ -18,15 +18,18 @@ Did you always want to increase the user interaction on your website by rating p
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.
@@ -40,7 +43,7 @@ See WP Review in action on our demo pages:
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>
@@ -52,7 +55,7 @@ Yes, this plugin is so developer friendly, so you could use it with any theme yo
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
 
@@ -76,15 +79,34 @@ Please disable all plugins and check if rating is working properly. Then you can
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.1 =
89
  * Fixed average star rating number issue.
90
  * Added New filter to exclude post types.
1
  === WP Review ===
2
  Contributors: mythemeshop
3
+ Creator's website link: http://mythemeshop.com/plugins/wp-review/
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: 4.0
7
+ Stable tag: 3.2
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
 
18
 
19
  = Live Demos =
20
  See WP Review in action on our demo pages:
21
+ * <a href="http://demo.mythemeshop.com/point/fatebuntur-stoici-haec-omnia-dicta-esse-praeclare/" target="_blank">Star Review Type</a>
22
+ * <a href="http://demo.mythemeshop.com/point/modo-etiam-paulum-ad-dexteram-de-via-declinavi/" target="_blank">Point Review Type</a>
23
+ * <a href="http://demo.mythemeshop.com/point/sed-nonne-merninisti-licere-mihi-ista-probare/" 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
+ * Option to set Global Position.
31
+ * Option to change Global Colors.
32
+ * Option to change individual review Colors and Positions.
33
  * Included tabbed widget to show recent reviews and popular reviews.
34
  * WP Multisite and Multiuser (WPMU / WPMS / WordPress MU) compatible.
35
  * Design it as you want, unlimited color options.
43
  * Minimalist, lightweight, and efficient code means that your users won’t notice any hiccups.
44
  * Position it above or below the content with ease and no coding.
45
  * Supports Shortcode `[wp-review]` to show review anywhere in post.
46
+ * Developer friendly - Useful filters are included! So you can use it in your themes.
47
 
48
  = Support =
49
  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>
55
  Show average review in your theme using below function:
56
  `<?php if (function_exists('wp_review_show_total')) wp_review_show_total(); ?>`
57
 
58
+ 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>.
59
 
60
  GitHub link: <a href="https://github.com/MyThemeShop/WP-Review-by-MyThemeShop">https://github.com/MyThemeShop/WP-Review-by-MyThemeShop</a>
61
 
79
 
80
  == Screenshots ==
81
 
82
+ 1. Options Panel
83
+ 2. Plugin Options
84
+ 3. Plugin Options 2
85
+ 4. Review Widget
86
+ 5. Star Review type
87
+ 6. Point Review type
88
+ 7. Percentage Review type
89
 
90
  == Changelog ==
91
 
92
+ = 3.2 =
93
+ * Added Options Panel for Global Option
94
+ * Added option to set Global Colors.
95
+ * Added option to Global position.
96
+ * Added option to add Global Features.
97
+ * Added option to change review description title (Summary).
98
+ * Added option to hide Description and Total Rating.
99
+ * Added option to add your own Total Score.
100
+ * Fixed schema tag issue in wp_review_show_total()
101
+ * Fixed jQuery issue.
102
+ * Fixed post preview issue.
103
+ * Fixed conflict with Redux Framework, Visual Composer and Mailpoet.
104
+ * Added New Filters.
105
+ * Updated No Preview thumbnail.
106
+ * Merged Star and Loader icon files in one.
107
+ * Fixed many small bugs.
108
+ * Optimized code for better performance.
109
+
110
  = 3.1 =
111
  * Fixed average star rating number issue.
112
  * Added New filter to exclude post types.
wp-review.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
3
  * Plugin Name: WP Review
4
- * Plugin URI: http://mythemeshop.com/
5
- * Description: Easily create custom review content.
6
- * Version: 3.1
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
@@ -22,83 +22,92 @@
22
 
23
  // Exit if accessed directly
24
  if ( ! defined( 'ABSPATH' ) ) exit;
 
 
25
 
26
- /* Sets the custom db table name. */
27
- define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );
28
-
29
- /* When plugin is activated */
30
- register_activation_hook( __FILE__, 'wp_review_activation' );
31
 
32
 
33
- /* Defines constants used by the plugin. */
34
- add_action( 'plugins_loaded', 'wp_review_constants', 1 );
35
 
36
- /* Internationalize the text strings used. */
37
- add_action( 'plugins_loaded', 'wp_review_i18n', 2 );
38
 
39
- /* Loads libraries. */
40
- add_action( 'plugins_loaded', 'wp_review_includes_libraries', 3 );
41
 
42
- /**
43
- * Defines constants.
44
- *
45
- * @since 1.0
46
- */
47
- function wp_review_constants() {
48
 
49
- /* Sets the path to the plugin directory. */
50
- define( 'WP_REVIEW_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
51
 
52
- /* Sets the path to the plugin directory URI. */
53
- define( 'WP_REVIEW_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );
54
 
55
- /* Sets the path to the `admin` directory. */
56
- define( 'WP_REVIEW_ADMIN', WP_REVIEW_DIR . trailingslashit( 'admin' ) );
57
 
58
- /* Sets the path to the `includes` directory. */
59
- define( 'WP_REVIEW_INCLUDES', WP_REVIEW_DIR . trailingslashit( 'includes' ) );
60
 
61
- /* Sets the path to the `assets` directory. */
62
- define( 'WP_REVIEW_ASSETS', WP_REVIEW_URI . trailingslashit( 'assets' ) );
63
 
64
- }
 
65
 
66
- /**
67
- * Internationalize the text strings used.
68
- *
69
- * @since 1.0
70
- */
71
- function wp_review_i18n() {
72
- load_plugin_textdomain( 'wp-review', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
73
- }
74
 
75
- /**
76
- * Loads the initial files needed by the plugin.
77
- *
78
- * @since 1.0
79
- */
80
- function wp_review_includes_libraries() {
 
 
81
 
82
- /* Loads the admin functions. */
83
- require_once( WP_REVIEW_ADMIN . 'admin.php' );
 
 
 
 
84
 
85
- /* Loads the meta boxes. */
86
- require_once( WP_REVIEW_ADMIN . 'metaboxes.php' );
87
 
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
 
97
- }
 
 
 
 
 
 
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
  ?>
1
  <?php
2
  /**
3
  * Plugin Name: WP Review
4
+ * Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
+ * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.
6
+ * Version: 3.2
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
22
 
23
  // Exit if accessed directly
24
  if ( ! defined( 'ABSPATH' ) ) exit;
25
+ // WP Review activated?
26
+ if ( ! defined( 'MTS_WP_REVIEW_DB_TABLE' ) ) {
27
 
28
+ /* Sets the custom db table name. */
29
+ define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );
30
+
31
+ /* When plugin is activated */
32
+ register_activation_hook( __FILE__, 'wp_review_activation' );
33
 
34
 
35
+ /* Defines constants used by the plugin. */
36
+ add_action( 'plugins_loaded', 'wp_review_constants', 1 );
37
 
38
+ /* Internationalize the text strings used. */
39
+ add_action( 'plugins_loaded', 'wp_review_i18n', 2 );
40
 
41
+ /* Loads libraries. */
42
+ add_action( 'plugins_loaded', 'wp_review_includes_libraries', 3 );
43
 
44
+ /**
45
+ * Defines constants.
46
+ *
47
+ * @since 1.0
48
+ */
49
+ function wp_review_constants() {
50
 
51
+ /* Sets the path to the plugin directory. */
52
+ define( 'WP_REVIEW_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
53
 
54
+ /* Sets the path to the plugin directory URI. */
55
+ define( 'WP_REVIEW_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );
56
 
57
+ /* Sets the path to the `admin` directory. */
58
+ define( 'WP_REVIEW_ADMIN', WP_REVIEW_DIR . trailingslashit( 'admin' ) );
59
 
60
+ /* Sets the path to the `includes` directory. */
61
+ define( 'WP_REVIEW_INCLUDES', WP_REVIEW_DIR . trailingslashit( 'includes' ) );
62
 
63
+ /* Sets the path to the `assets` directory. */
64
+ define( 'WP_REVIEW_ASSETS', WP_REVIEW_URI . trailingslashit( 'assets' ) );
65
 
66
+ /* Sets plugin base 'directory/file.php' */
67
+ define( 'WP_REVIEW_PLUGIN_BASE', plugin_basename(__FILE__) );
68
 
69
+ }
 
 
 
 
 
 
 
70
 
71
+ /**
72
+ * Internationalize the text strings used.
73
+ *
74
+ * @since 1.0
75
+ */
76
+ function wp_review_i18n() {
77
+ load_plugin_textdomain( 'wp-review', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
78
+ }
79
 
80
+ /**
81
+ * Loads the initial files needed by the plugin.
82
+ *
83
+ * @since 1.0
84
+ */
85
+ function wp_review_includes_libraries() {
86
 
87
+ /* Loads the admin functions. */
88
+ require_once( WP_REVIEW_ADMIN . 'admin.php' );
89
 
90
+ /* Loads the meta boxes. */
91
+ require_once( WP_REVIEW_ADMIN . 'metaboxes.php' );
92
 
93
+ /* Loads the front-end functions. */
94
+ require_once( WP_REVIEW_INCLUDES . 'functions.php' );
95
 
96
+ /* Loads the widget. */
97
+ require_once( WP_REVIEW_INCLUDES . 'widget.php' );
98
 
99
+ /* Loads the enqueue functions. */
100
+ require_once( WP_REVIEW_INCLUDES . 'enqueue.php' );
101
+
102
+ /* Loads the settings page. */
103
+ require_once( WP_REVIEW_ADMIN . 'options.php' );
104
+
105
+ }
106
 
107
+ function wp_review_activation(){
108
+ /* Loads activation functions */
109
+ //require_once( plugin_dir_path( __FILE__ ) . '/includes/functions.php' );
110
+ require_once( plugin_dir_path( __FILE__ ) . '/admin/activation.php' );
111
+ }
112
  }
113
  ?>