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 <