WP Product Review Lite - Version 2.2.4

Version Description

Download this release

Release Info

Developer codeinwp
Plugin Icon WP Product Review Lite
Version 2.2.4
Comparing to
See all releases

Code changes from version 2.2.7 to 2.2.4

admin/inc/config.php CHANGED
@@ -36,7 +36,7 @@
36
 
37
  public static function init(){
38
 
39
- self::$admin_page_menu_name = "Product Review";
40
 
41
  self::$admin_page_title = "WP Product Review Options";
42
 
@@ -264,23 +264,7 @@
264
 
265
  "default"=>"Cons"
266
 
267
- ),
268
-
269
- array(
270
- "type"=>"color",
271
- "name"=>"Review box border",
272
- "description"=>"Select the border color to be used on the review box",
273
- "id"=>"cwppos_reviewboxbd_color",
274
- "default"=>"#3BAEDA"
275
- ),
276
-
277
- array(
278
- "type"=>"input_text",
279
- "name"=>"Review box border width",
280
- "description"=>"Select the width in pixels of the top border of the review box",
281
- "id"=>"cwppos_reviewboxbd_width",
282
- "default"=>"5"
283
- )
284
 
285
 
286
 
@@ -480,55 +464,7 @@
480
 
481
  )
482
 
483
- ),
484
- array(
485
-
486
- "type"=>"tab",
487
-
488
- "name"=>"Upgrade to Pro",
489
-
490
- "options"=>array(
491
-
492
-
493
-
494
- array(
495
-
496
- "type"=>"title",
497
-
498
- "name"=>"In order to use the PRO features, you have 2 options :"
499
-
500
- ),
501
- array(
502
-
503
- "type"=>"select",
504
-
505
- "name"=>"Display the Powered by link ?",
506
-
507
- "description"=>"If you wanna use our Preloader functionality without paying for the plugin, just activate this box and a nofollow link will be added to your review posts",
508
-
509
- "id"=>"cwppos_show_poweredby",
510
-
511
- "options"=>array("yes"=>"Yes","no"=>"No"),
512
-
513
- "default"=>"no"
514
-
515
- ),
516
- array(
517
-
518
- "type"=>"button",
519
-
520
- "name"=>"Buy the PRO version ",
521
-
522
- "description"=>"Buy the PRO version now for only $9.95",
523
-
524
- "id"=>"cwppos_show_buypro",
525
-
526
-
527
- "default"=>"no"
528
-
529
- )
530
- )
531
- )
532
 
533
 
534
 
36
 
37
  public static function init(){
38
 
39
+ self::$admin_page_menu_name = "WP Product Review Options";
40
 
41
  self::$admin_page_title = "WP Product Review Options";
42
 
264
 
265
  "default"=>"Cons"
266
 
267
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
 
269
 
270
 
464
 
465
  )
466
 
467
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
 
469
 
470
 
admin/inc/loader.php CHANGED
@@ -7,7 +7,7 @@ add_action( 'admin_menu', 'cwppos_options_add_page' );
7
  function cwppos_options_add_page() {
8
 
9
  $render = new cwpposRenderView();
10
- add_menu_page( __( cwppos_config("admin_page_title"), 'cwppos' ), __( cwppos_config("admin_page_menu_name"), 'cwppos' ), 'manage_options', cwppos_config("menu_slug"), array($render,'show'), "dashicons-star-half" ,'99.87414' );
11
  }
12
 
13
  function cwppos_config($config_name, $echo = 0){
7
  function cwppos_options_add_page() {
8
 
9
  $render = new cwpposRenderView();
10
+ add_options_page( __( cwppos_config("admin_page_title"), 'cwppos' ), __( cwppos_config("admin_page_menu_name"), 'cwppos' ), 'manage_options', cwppos_config("menu_slug"), array($render,'show'), "" ,61 );
11
  }
12
 
13
  function cwppos_config($config_name, $echo = 0){
admin/inc/render.php CHANGED
@@ -14,7 +14,7 @@
14
  $this->add_js("main_page_js",$js_path."admin.js");
15
  $this->add_js("typsy",$js_path."tipsy.js");
16
  $this->add_js("jquery" );
17
- //$this->add_js("media" );
18
 
19
  $this->options = get_option(cwppos_config("menu_slug"));
20
 
@@ -64,11 +64,6 @@
64
 
65
  $this->add_image($tabid,esc_html($field['name']),esc_html($field["description"]),esc_attr($field['id']));
66
 
67
- break;
68
- case 'button':
69
-
70
- $this->add_button($tabid,esc_html($field['name']),esc_html($field["description"]),esc_attr($field['id']));
71
-
72
  break;
73
  case 'typography':
74
 
@@ -489,19 +484,6 @@
489
  "html"=>$html
490
  );
491
  }
492
-
493
- public function add_button($tabid,$name,$description,$id,$class = ''){
494
- $html = '
495
- <div class="controls '.$class.' ">
496
- <div class="explain">'.$name.'</div><p class="field_description">'.$description.'</p>
497
- <a href="http://www.readythemes.com/wp-product-review-pro/" class="button" target="_blank" style="color:red; text-decoration: none; ">'.$name.'</a>
498
- </div></div>';
499
- $this->tabs[$tabid]["elements"][] = array(
500
- "type"=>"button",
501
- "html"=>$html
502
- );
503
- }
504
-
505
  public function add_color($tabid,$name,$description,$id,$class = ''){
506
 
507
 
14
  $this->add_js("main_page_js",$js_path."admin.js");
15
  $this->add_js("typsy",$js_path."tipsy.js");
16
  $this->add_js("jquery" );
17
+ $this->add_js("media" );
18
 
19
  $this->options = get_option(cwppos_config("menu_slug"));
20
 
64
 
65
  $this->add_image($tabid,esc_html($field['name']),esc_html($field["description"]),esc_attr($field['id']));
66
 
 
 
 
 
 
67
  break;
68
  case 'typography':
69
 
484
  "html"=>$html
485
  );
486
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  public function add_color($tabid,$name,$description,$id,$class = ''){
488
 
489
 
admin/layout/js/admin.js CHANGED
@@ -4,9 +4,9 @@ jQuery("document").ready(function() {
4
 
5
  jQuery("#cwp_container").fadeIn(200);
6
 
7
- var _custom_media = true;
8
 
9
- //_orig_send_attachment = wp.media.editor.send.attachment;
10
 
11
 
12
 
@@ -19,11 +19,52 @@ jQuery("document").ready(function() {
19
  return false;
20
  });
21
 
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  jQuery(".subo-color-picker").wpColorPicker({ change: function(event, ui){
25
  var color = ui.color.toCSS();
26
-
27
  var id = jQuery(this).attr('id').replace('_color_selector', '');
28
 
29
 
4
 
5
  jQuery("#cwp_container").fadeIn(200);
6
 
7
+ var _custom_media = true,
8
 
9
+ _orig_send_attachment = wp.media.editor.send.attachment;
10
 
11
 
12
 
19
  return false;
20
  });
21
 
22
+ jQuery('.selector-image').click(function(e) {
23
+
24
+ var send_attachment_bkp = wp.media.editor.send.attachment;
25
+
26
+ var button = jQuery(this);
27
+
28
+ var id = button.attr('id').replace('_button', '');
29
+
30
+ _custom_media = true;
31
+
32
+ wp.media.frames.file_frame = wp.media({
33
+ title: "Select Image",
34
+ button: {
35
+ text: 'Select Image'
36
+ },
37
+ multiple: false
38
+ });
39
+ wp.media.editor.send.attachment = function(props, attachment){
40
+
41
+ if ( _custom_media ) {
42
+
43
+ jQuery("#"+id).val(attachment.url);
44
+ jQuery("#"+id+"_image").attr("src",attachment.url).show();
45
+
46
+ jQuery("#"+id+"-gradientcolor").hide();
47
+ jQuery("#"+id+"-gradientselector").hide();
48
+ } else {
49
+
50
+ return _orig_send_attachment.apply( this, [props, attachment] );
51
+
52
+ };
53
+
54
+ }
55
+
56
+ wp.media.editor.open(button);
57
+ setInterval(function(){
58
+ if(jQuery('a.media-button-insert').text() != 'Use this Image' )
59
+ jQuery('a.media-button-insert').text('Use this Image');
60
+ },100)
61
+ return false;
62
+
63
+ });
64
 
65
  jQuery(".subo-color-picker").wpColorPicker({ change: function(event, ui){
66
  var color = ui.color.toCSS();
67
+ console.log(color);
68
  var id = jQuery(this).attr('id').replace('_color_selector', '');
69
 
70
 
admin/layout/main_page.php CHANGED
@@ -9,11 +9,11 @@
9
 
10
  <img class="theme_options_logo" src="<?php echo plugins_url( 'img/logo.png' , __FILE__ ) . ''; ?>" alt="<?php echo cwppos_config('admin_page_header'); ?>">
11
 
12
- <?php if (!class_exists('CWP_PR_PRO_Core')) { ?><a href="http://www.readythemes.com/wp-product-review-pro/?r=wporg" class="read_docs button" target="_blank" style="color:red;text-decoration: none;"><?php _e("Buy the PRO version", "cwppos"); ?></a><?php } ?>
13
 
14
- <a href="http://www.readythemes.com/category/themes/?r=wporg" class="read_docs button" target="_blank" style=" text-decoration: none; "><?php _e("Recommended Review Themes", "cwppos"); ?></a>
15
 
16
- <a href="http://www.readythemes.com/contact/" target="_blank" class="read_docs button" style="text-decoration: none;"><?php _e("Contact us", "cwppos"); ?></a>
17
 
18
  </h2>
19
  </div>
9
 
10
  <img class="theme_options_logo" src="<?php echo plugins_url( 'img/logo.png' , __FILE__ ) . ''; ?>" alt="<?php echo cwppos_config('admin_page_header'); ?>">
11
 
12
+ <a href="https://themeisle.com/plugins/wp-product-review-lite/" class="read_docs button" target="_blank" style="text-decoration: none;"><?php _e("Visit Plugin Page", "cwp"); ?></a>
13
 
14
+ <a href="https://themeisle.com/allthemes/" class="read_docs button" target="_blank" style="color:red; text-decoration: none; "><?php _e("Recommended Review Themes", "cwp"); ?></a>
15
 
16
+ <a href="https://themeisle.com/contact/" target="_blank" class="read_docs button" style="text-decoration: none;"><?php _e("Contact us", "cwp"); ?></a>
17
 
18
  </h2>
19
  </div>
css/cwppos-widget.css DELETED
@@ -1,12 +0,0 @@
1
- /* Sidebar Popular Reviews Widget */
2
-
3
- .cwp-popular-review { position: relative; border-bottom: 1px solid #ddd; margin: 0; padding: 15px 0px!important;}
4
-
5
- .cwp-popular-review .cwp-review-chart canvas, .cwp-popular-review .cwp-review-chart span { width: 40px!important; height: 40px!important; line-height: 2.3; }
6
- .cwp-popular-review .cwp-review-chart .cwp-review-percentage { top: -1px; left: -1px; }
7
- .cwp-popular-review .cwp-review-chart { border: 0px solid #fff; width: 40px; height: 40px; top: 56%; margin-top: -22px; }
8
- /* Review Pie Chart Styles */
9
- .cwp-review-chart { float: left; margin: 10px;margin-right:0px; position: absolute;top: 0;right: 0; border: 3px solid #fff; border-radius: 50%;}
10
- .cwp-review-percentage span { font-family: "Lato"; font-size: 17px; font-weight: 900; background: #fff; display: block;border-radius: 50%; }
11
- .easyPieChart { position: relative; text-align: center; }
12
- .easyPieChart canvas { position: absolute; top: 0; left: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
css/frontpage.css CHANGED
@@ -211,7 +211,7 @@ margin-bottom: 9%;}
211
 
212
 
213
 
214
- .affiliate-button { width:100%; margin-bottom:20px; clear:both;}
215
 
216
  .affiliate-button a { display: table; margin: 0 auto; border: none; border-radius: none; padding: 10px 35px; margin-top: 20px; border-radius: 5px; text-decoration: none !important; }
217
 
211
 
212
 
213
 
214
+ .affiliate-button { width:100%; margin-bottom:20px; }
215
 
216
  .affiliate-button a { display: table; margin: 0 auto; border: none; border-radius: none; padding: 10px 35px; margin-top: 20px; border-radius: 5px; text-decoration: none !important; }
217
 
inc/class-remote-notification-client.php CHANGED
@@ -1,381 +1,381 @@
1
- <?php
2
- /**
3
- * Remote Dashobard Notifications.
4
- *
5
- * This class is part of the Remote Dashboard Notifications plugin.
6
- * This plugin allows you to send notifications to your client's
7
- * WordPress dashboard easily.
8
- *
9
- * Notification you send will be displayed as admin notifications
10
- * using the standard WordPress hooks. A "dismiss" option is added
11
- * in order to let the user hide the notification.
12
- *
13
- * @package Remote Dashboard Notifications
14
- * @author ThemeAvenue <web@themeavenue.net>
15
- * @license GPL-2.0+
16
- * @link http://themeavenue.net
17
- * @link http://wordpress.org/plugins/remote-dashboard-notifications/
18
- * @link https://github.com/ThemeAvenue/Remote-Dashboard-Notifications
19
- * @copyright 2014 ThemeAvenue
20
- */
21
-
22
- // If this file is called directly, abort.
23
- if ( ! defined( 'WPINC' ) ) {
24
- die;
25
- }
26
-
27
- class TAV_Remote_Notification_Client {
28
-
29
- /**
30
- * Class version.
31
- *
32
- * @since 0.1.0
33
- *
34
- * @var string
35
- */
36
- protected static $version = '0.1.2';
37
-
38
- public function __construct( $channel_id = false, $channel_key = false, $server = false, $debug = false ) {
39
-
40
- /* Don't continue during Ajax process */
41
- if( !is_admin() || defined( 'DOING_AJAX' ) && DOING_AJAX )
42
- return;
43
-
44
- $this->id = intval( $channel_id );
45
- $this->key = sanitize_key( $channel_key );
46
- $this->server = esc_url( $server );
47
- $this->notice = false;
48
- $this->cache = apply_filters( 'rn_notice_caching_time', 6 );
49
- $this->debug = $debug;
50
- $this->error = null;
51
-
52
- /* The plugin can't work without those 2 parameters */
53
- if( false === ( $this->id || $this->key || $this->server ) )
54
- return;
55
-
56
- /* Call the dismiss method before testing for Ajax */
57
- if( isset( $_GET['rn'] ) && isset( $_GET['notification'] ) )
58
- add_action( 'init', array( $this, 'dismiss' ) );
59
-
60
- add_action( 'init', array( $this, 'request_server' ) );
61
-
62
- }
63
-
64
- /**
65
- * Send a request to notification server
66
- *
67
- * The distant WordPress notification server is
68
- * queried using the WordPress HTTP API.
69
- *
70
- * @since 0.1.0
71
- */
72
- public function request_server() {
73
-
74
- /* Current channel ID */
75
- $channel_id = $this->id;
76
-
77
- /* Current channel key */
78
- $channel_key = $this->key;
79
-
80
- /* Generate a unique identifyer used for the transient */
81
- $uniqid = $channel_id . substr( $channel_key, 0, 5 );
82
-
83
- /* Prepare the payload to send to server */
84
- $payload = base64_encode( json_encode( array( 'channel' => $channel_id, 'key' => $channel_key ) ) );
85
-
86
- /* Get the endpoint URL ready */
87
- $url = add_query_arg( array( 'payload' => $payload ), $this->server );
88
-
89
- /* Content is false at first */
90
- $content = get_transient( "rn_last_notification_$uniqid" );
91
-
92
- /* Set the request response to null */
93
- $request = null;
94
-
95
- /* If no notice is present in DB we query the server */
96
- if( false === $content || defined( 'RDN_DEV' ) && RDN_DEV ) {
97
-
98
- /* Query the server */
99
- $request = wp_remote_get( $url, array( 'timeout' => apply_filters( 'rn_http_request_timeout', 5 ) ) );
100
-
101
- /* If we have a WP_Error object we abort */
102
- if( is_wp_error( $request ) )
103
- return;
104
-
105
- /* Check if we have a valid response */
106
- if( is_array( $request ) && isset( $request['response']['code'] ) && 200 === intval( $request['response']['code'] ) ) {
107
-
108
- /* Get the response body */
109
- if( isset( $request['body'] ) ) {
110
-
111
- /**
112
- * Decode the response JSON string
113
- */
114
- $content = json_decode( $request['body'] );
115
-
116
- /**
117
- * Check if the payload is in a usable JSON format
118
- */
119
- if( version_compare( phpversion(), '5.3.0', '>=' ) ) {
120
-
121
- if( ! ( json_last_error() == JSON_ERROR_NONE ) )
122
- return false;
123
-
124
- } else {
125
-
126
- if( $content == NULL )
127
- return false;
128
-
129
- }
130
-
131
- set_transient( "rn_last_notification_$uniqid", $content, $this->cache*60*60 );
132
-
133
- }
134
-
135
- }
136
-
137
- }
138
-
139
- /**
140
- * If the JSON string has been decoded we can go ahead
141
- */
142
- if( is_object( $content ) ) {
143
-
144
- if( isset( $content->error ) ) {
145
-
146
- /* Display debug info in the admin footer */
147
- if( true === $this->debug ) {
148
-
149
- /* Save the error message */
150
- $this->error = $content->error;
151
-
152
- /* Display it commented in the footer */
153
- add_action( 'admin_footer', array( $this, 'debug_info' ) );
154
-
155
- }
156
-
157
- /* Stop */
158
- return;
159
-
160
- }
161
-
162
- $this->notice = $content;
163
-
164
- /**
165
- * Check if notice has already been dismissed
166
- */
167
- $dismissed = get_option( '_rn_dismissed' );
168
-
169
- if( is_array( $dismissed ) && in_array( $content->slug, $dismissed ) )
170
- return;
171
-
172
- /**
173
- * Add the notice style
174
- */
175
- add_action( 'admin_print_styles', array( $this, 'style' ), 100 );
176
-
177
- /**
178
- * Add the notice to WP dashboard
179
- */
180
- add_action( 'admin_notices', array( $this, 'show_notice' ) );
181
-
182
- } else {
183
-
184
- return false;
185
-
186
- }
187
-
188
- }
189
-
190
- /**
191
- * Display the admin notice
192
- *
193
- * The function will do some checks to verify if
194
- * the notice can be displayed on the current page.
195
- * If all the checks are passed, the notice
196
- * is added to the page.
197
- *
198
- * @since 0.1.0
199
- */
200
- public function show_notice() {
201
-
202
- $content = $this->notice;
203
-
204
- /* If there is no content we abort */
205
- if( false === $content )
206
- return;
207
-
208
- /* If the type array isn't empty we have a limitation */
209
- if( isset( $content->type ) && is_array( $content->type ) && !empty( $content->type ) ) {
210
-
211
- /* Get current post type */
212
- $pt = get_post_type();
213
-
214
- /**
215
- * If the current post type can't be retrieved
216
- * or if it's not in the allowed post types,
217
- * then we don't display the admin notice.
218
- */
219
- if( false === $pt || !in_array( $pt, $content->type ) )
220
- return;
221
-
222
- }
223
-
224
- /* Prepare alert class */
225
- $style = isset( $content->style ) ? $content->style : 'updated';
226
-
227
- if( 'updated' == $style )
228
- $class = $style;
229
-
230
- elseif( 'error' == $style )
231
- $class = 'updated error';
232
-
233
- else
234
- $class = "updated rn-alert rn-alert-$style";
235
-
236
- /**
237
- * Prepare the dismiss URL
238
- *
239
- * @var (string) URL
240
- * @todo get a more accurate URL of the current page
241
- */
242
- $args = array();
243
- $nonce = wp_create_nonce( 'rn-dismiss' );
244
- $slug = $content->slug;
245
-
246
- array_push( $args, "rn=$nonce" );
247
- array_push( $args, "notification=$slug" );
248
-
249
- foreach( $_GET as $key => $value ) {
250
-
251
- array_push( $args, "$key=$value" );
252
-
253
- }
254
-
255
- $args = implode( '&', $args );
256
- $url = "?$args";
257
- ?>
258
-
259
- <div class="<?php echo $class; ?>">
260
- <?php if( !in_array( $style, array( 'updated', 'error' ) ) ): ?><a href="<?php echo $url; ?>" id="rn-dismiss" class="rn-dismiss-btn" title="<?php _e( 'Dismiss notification', 'remote-notifications' ); ?>">&times;</a><?php endif; ?>
261
- <p><?php echo html_entity_decode( $content->message ); ?></p>
262
- <?php if( in_array( $style, array( 'updated', 'error' ) ) ): ?><p><a href="<?php echo $url; ?>" id="rn-dismiss" class="rn-dismiss-button button-secondary"><?php _e( 'Dismiss', 'remote-notifications' ); ?></a></p><?php endif; ?>
263
- </div>
264
- <?php
265
-
266
- }
267
-
268
- /**
269
- * Dismiss notice
270
- *
271
- * When the user dismisses a notice, its slug
272
- * is added to the _rn_dismissed entry in the DB options table.
273
- * This entry is then used to check if a notie has been dismissed
274
- * before displaying it on the dashboard.
275
- *
276
- * @since 0.1.0
277
- */
278
- public function dismiss() {
279
-
280
- /* Check if we have all the vars */
281
- if( !isset( $_GET['rn'] ) || !isset( $_GET['notification'] ) )
282
- return;
283
-
284
- /* Validate nonce */
285
- if( !wp_verify_nonce( sanitize_key( $_GET['rn'] ), 'rn-dismiss' ) )
286
- return;
287
-
288
- /* Get dismissed list */
289
- $dismissed = get_option( '_rn_dismissed', array() );
290
-
291
- /* Add the current notice to the list if needed */
292
- if( is_array( $dismissed ) && !in_array( $_GET['notification'], $dismissed ) )
293
- array_push( $dismissed, $_GET['notification'] );
294
-
295
- /* Update option */
296
- update_option( '_rn_dismissed', $dismissed );
297
-
298
- /* Get redirect URL */
299
- $args = array();
300
-
301
- /* Get URL args */
302
- foreach( $_GET as $key => $value ) {
303
-
304
- if( in_array( $key, array( 'rn', 'notification' ) ) )
305
- continue;
306
-
307
- array_push( $args, "$key=$value" );
308
-
309
- }
310
-
311
- $args = implode( '&', $args );
312
- $url = "?$args";
313
-
314
- /* Redirect */
315
- wp_redirect( $url );
316
-
317
- }
318
-
319
- /**
320
- * Adds inline style for non standard notices
321
- *
322
- * This function will only be called if the notice style is not standard.
323
- *
324
- * @since 0.1.0
325
- */
326
- public function style() { ?>
327
-
328
- <style type="text/css">div.rn-alert{padding:15px;padding-right:35px;margin-bottom:20px;border:1px solid transparent;-webkit-box-shadow:none;box-shadow:none}div.rn-alert p:empty{display:none}div.rn-alert ul,div.rn-alert ul li,div.rn-alert ol,div.rn-alert ol li{list-style:inherit !important}div.rn-alert ul,div.rn-alert ol{padding-left:30px}div.rn-alert hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}div.rn-alert h1,h2,h3,h4,h5,h6{margin-top:0;color:inherit}div.rn-alert a{font-weight:700}div.rn-alert a:hover{text-decoration:underline}div.rn-alert>p{margin:0;padding:0;line-height:1}div.rn-alert>p,div.rn-alert>ul{margin-bottom:0}div.rn-alert>p+p{margin-top:5px}div.rn-alert .rn-dismiss-btn{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;top:-2px;right:-21px;padding:0;cursor:pointer;background:0;border:0;-webkit-appearance:none;float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20);text-decoration:none}div.rn-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}div.rn-alert-success hr{border-top-color:#c9e2b3}div.rn-alert-success a{color:#2b542c}div.rn-alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}div.rn-alert-info hr{border-top-color:#a6e1ec}div.rn-alert-info a{color:#245269}div.rn-alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}div.rn-alert-warning hr{border-top-color:#f7e1b5}div.rn-alert-warning a{color:#66512c}div.rn-alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}div.rn-alert-danger hr{border-top-color:#e4b9c0}div.rn-alert-danger a{color:#843534}</style>
329
-
330
- <?php }
331
-
332
- /**
333
- * Dismiss notice using Ajax
334
- *
335
- * This function is NOT used. Testing only.
336
- */
337
- public function script() {
338
-
339
- $url = admin_url();
340
- ?>
341
-
342
- <script type="text/javascript">
343
- jQuery(document).ready(function($) {
344
-
345
- var prout = 'prout';
346
-
347
- $('#rn-dismiss').on('click', function(event) {
348
- event.preventDefault();
349
- $.ajax({
350
- type: "GET",
351
- url: <?php echo $url; ?>,
352
- data: prout
353
- });
354
- console.log('clicked');
355
- });
356
-
357
- return false;
358
-
359
- });
360
- </script>
361
-
362
- <?php
363
-
364
- }
365
-
366
- /**
367
- * Debug info.
368
- *
369
- * Display an error message commented in the admin footer.
370
- *
371
- * @since 0.1.2
372
- */
373
- public function debug_info() {
374
-
375
- $error = $this->error;
376
-
377
- echo "<!-- RDN Debug Info: $error -->";
378
-
379
- }
380
-
381
  }
1
+ <?php
2
+ /**
3
+ * Remote Dashobard Notifications.
4
+ *
5
+ * This class is part of the Remote Dashboard Notifications plugin.
6
+ * This plugin allows you to send notifications to your client's
7
+ * WordPress dashboard easily.
8
+ *
9
+ * Notification you send will be displayed as admin notifications
10
+ * using the standard WordPress hooks. A "dismiss" option is added
11
+ * in order to let the user hide the notification.
12
+ *
13
+ * @package Remote Dashboard Notifications
14
+ * @author ThemeAvenue <web@themeavenue.net>
15
+ * @license GPL-2.0+
16
+ * @link http://themeavenue.net
17
+ * @link http://wordpress.org/plugins/remote-dashboard-notifications/
18
+ * @link https://github.com/ThemeAvenue/Remote-Dashboard-Notifications
19
+ * @copyright 2014 ThemeAvenue
20
+ */
21
+
22
+ // If this file is called directly, abort.
23
+ if ( ! defined( 'WPINC' ) ) {
24
+ die;
25
+ }
26
+
27
+ class TAV_Remote_Notification_Client {
28
+
29
+ /**
30
+ * Class version.
31
+ *
32
+ * @since 0.1.0
33
+ *
34
+ * @var string
35
+ */
36
+ protected static $version = '0.1.2';
37
+
38
+ public function __construct( $channel_id = false, $channel_key = false, $server = false, $debug = false ) {
39
+
40
+ /* Don't continue during Ajax process */
41
+ if( !is_admin() || defined( 'DOING_AJAX' ) && DOING_AJAX )
42
+ return;
43
+
44
+ $this->id = intval( $channel_id );
45
+ $this->key = sanitize_key( $channel_key );
46
+ $this->server = esc_url( $server );
47
+ $this->notice = false;
48
+ $this->cache = apply_filters( 'rn_notice_caching_time', 6 );
49
+ $this->debug = $debug;
50
+ $this->error = null;
51
+
52
+ /* The plugin can't work without those 2 parameters */
53
+ if( false === ( $this->id || $this->key || $this->server ) )
54
+ return;
55
+
56
+ /* Call the dismiss method before testing for Ajax */
57
+ if( isset( $_GET['rn'] ) && isset( $_GET['notification'] ) )
58
+ add_action( 'init', array( $this, 'dismiss' ) );
59
+
60
+ add_action( 'init', array( $this, 'request_server' ) );
61
+
62
+ }
63
+
64
+ /**
65
+ * Send a request to notification server
66
+ *
67
+ * The distant WordPress notification server is
68
+ * queried using the WordPress HTTP API.
69
+ *
70
+ * @since 0.1.0
71
+ */
72
+ public function request_server() {
73
+
74
+ /* Current channel ID */
75
+ $channel_id = $this->id;
76
+
77
+ /* Current channel key */
78
+ $channel_key = $this->key;
79
+
80
+ /* Generate a unique identifyer used for the transient */
81
+ $uniqid = $channel_id . substr( $channel_key, 0, 5 );
82
+
83
+ /* Prepare the payload to send to server */
84
+ $payload = base64_encode( json_encode( array( 'channel' => $channel_id, 'key' => $channel_key ) ) );
85
+
86
+ /* Get the endpoint URL ready */
87
+ $url = add_query_arg( array( 'payload' => $payload ), $this->server );
88
+
89
+ /* Content is false at first */
90
+ $content = get_transient( "rn_last_notification_$uniqid" );
91
+
92
+ /* Set the request response to null */
93
+ $request = null;
94
+
95
+ /* If no notice is present in DB we query the server */
96
+ if( false === $content || defined( 'RDN_DEV' ) && RDN_DEV ) {
97
+
98
+ /* Query the server */
99
+ $request = wp_remote_get( $url, array( 'timeout' => apply_filters( 'rn_http_request_timeout', 5 ) ) );
100
+
101
+ /* If we have a WP_Error object we abort */
102
+ if( is_wp_error( $request ) )
103
+ return;
104
+
105
+ /* Check if we have a valid response */
106
+ if( is_array( $request ) && isset( $request['response']['code'] ) && 200 === intval( $request['response']['code'] ) ) {
107
+
108
+ /* Get the response body */
109
+ if( isset( $request['body'] ) ) {
110
+
111
+ /**
112
+ * Decode the response JSON string
113
+ */
114
+ $content = json_decode( $request['body'] );
115
+
116
+ /**
117
+ * Check if the payload is in a usable JSON format
118
+ */
119
+ if( version_compare( phpversion(), '5.3.0', '>=' ) ) {
120
+
121
+ if( ! ( json_last_error() == JSON_ERROR_NONE ) )
122
+ return false;
123
+
124
+ } else {
125
+
126
+ if( $content == NULL )
127
+ return false;
128
+
129
+ }
130
+
131
+ set_transient( "rn_last_notification_$uniqid", $content, $this->cache*60*60 );
132
+
133
+ }
134
+
135
+ }
136
+
137
+ }
138
+
139
+ /**
140
+ * If the JSON string has been decoded we can go ahead
141
+ */
142
+ if( is_object( $content ) ) {
143
+
144
+ if( isset( $content->error ) ) {
145
+
146
+ /* Display debug info in the admin footer */
147
+ if( true === $this->debug ) {
148
+
149
+ /* Save the error message */
150
+ $this->error = $content->error;
151
+
152
+ /* Display it commented in the footer */
153
+ add_action( 'admin_footer', array( $this, 'debug_info' ) );
154
+
155
+ }
156
+
157
+ /* Stop */
158
+ return;
159
+
160
+ }
161
+
162
+ $this->notice = $content;
163
+
164
+ /**
165
+ * Check if notice has already been dismissed
166
+ */
167
+ $dismissed = get_option( '_rn_dismissed' );
168
+
169
+ if( is_array( $dismissed ) && in_array( $content->slug, $dismissed ) )
170
+ return;
171
+
172
+ /**
173
+ * Add the notice style
174
+ */
175
+ add_action( 'admin_print_styles', array( $this, 'style' ), 100 );
176
+
177
+ /**
178
+ * Add the notice to WP dashboard
179
+ */
180
+ add_action( 'admin_notices', array( $this, 'show_notice' ) );
181
+
182
+ } else {
183
+
184
+ return false;
185
+
186
+ }
187
+
188
+ }
189
+
190
+ /**
191
+ * Display the admin notice
192
+ *
193
+ * The function will do some checks to verify if
194
+ * the notice can be displayed on the current page.
195
+ * If all the checks are passed, the notice
196
+ * is added to the page.
197
+ *
198
+ * @since 0.1.0
199
+ */
200
+ public function show_notice() {
201
+
202
+ $content = $this->notice;
203
+
204
+ /* If there is no content we abort */
205
+ if( false === $content )
206
+ return;
207
+
208
+ /* If the type array isn't empty we have a limitation */
209
+ if( isset( $content->type ) && is_array( $content->type ) && !empty( $content->type ) ) {
210
+
211
+ /* Get current post type */
212
+ $pt = get_post_type();
213
+
214
+ /**
215
+ * If the current post type can't be retrieved
216
+ * or if it's not in the allowed post types,
217
+ * then we don't display the admin notice.
218
+ */
219
+ if( false === $pt || !in_array( $pt, $content->type ) )
220
+ return;
221
+
222
+ }
223
+
224
+ /* Prepare alert class */
225
+ $style = isset( $content->style ) ? $content->style : 'updated';
226
+
227
+ if( 'updated' == $style )
228
+ $class = $style;
229
+
230
+ elseif( 'error' == $style )
231
+ $class = 'updated error';
232
+
233
+ else
234
+ $class = "updated rn-alert rn-alert-$style";
235
+
236
+ /**
237
+ * Prepare the dismiss URL
238
+ *
239
+ * @var (string) URL
240
+ * @todo get a more accurate URL of the current page
241
+ */
242
+ $args = array();
243
+ $nonce = wp_create_nonce( 'rn-dismiss' );
244
+ $slug = $content->slug;
245
+
246
+ array_push( $args, "rn=$nonce" );
247
+ array_push( $args, "notification=$slug" );
248
+
249
+ foreach( $_GET as $key => $value ) {
250
+
251
+ array_push( $args, "$key=$value" );
252
+
253
+ }
254
+
255
+ $args = implode( '&', $args );
256
+ $url = "?$args";
257
+ ?>
258
+
259
+ <div class="<?php echo $class; ?>">
260
+ <?php if( !in_array( $style, array( 'updated', 'error' ) ) ): ?><a href="<?php echo $url; ?>" id="rn-dismiss" class="rn-dismiss-btn" title="<?php _e( 'Dismiss notification', 'remote-notifications' ); ?>">&times;</a><?php endif; ?>
261
+ <p><?php echo html_entity_decode( $content->message ); ?></p>
262
+ <?php if( in_array( $style, array( 'updated', 'error' ) ) ): ?><p><a href="<?php echo $url; ?>" id="rn-dismiss" class="rn-dismiss-button button-secondary"><?php _e( 'Dismiss', 'remote-notifications' ); ?></a></p><?php endif; ?>
263
+ </div>
264
+ <?php
265
+
266
+ }
267
+
268
+ /**
269
+ * Dismiss notice
270
+ *
271
+ * When the user dismisses a notice, its slug
272
+ * is added to the _rn_dismissed entry in the DB options table.
273
+ * This entry is then used to check if a notie has been dismissed
274
+ * before displaying it on the dashboard.
275
+ *
276
+ * @since 0.1.0
277
+ */
278
+ public function dismiss() {
279
+
280
+ /* Check if we have all the vars */
281
+ if( !isset( $_GET['rn'] ) || !isset( $_GET['notification'] ) )
282
+ return;
283
+
284
+ /* Validate nonce */
285
+ if( !wp_verify_nonce( sanitize_key( $_GET['rn'] ), 'rn-dismiss' ) )
286
+ return;
287
+
288
+ /* Get dismissed list */
289
+ $dismissed = get_option( '_rn_dismissed', array() );
290
+
291
+ /* Add the current notice to the list if needed */
292
+ if( is_array( $dismissed ) && !in_array( $_GET['notification'], $dismissed ) )
293
+ array_push( $dismissed, $_GET['notification'] );
294
+
295
+ /* Update option */
296
+ update_option( '_rn_dismissed', $dismissed );
297
+
298
+ /* Get redirect URL */
299
+ $args = array();
300
+
301
+ /* Get URL args */
302
+ foreach( $_GET as $key => $value ) {
303
+
304
+ if( in_array( $key, array( 'rn', 'notification' ) ) )
305
+ continue;
306
+
307
+ array_push( $args, "$key=$value" );
308
+
309
+ }
310
+
311
+ $args = implode( '&', $args );
312
+ $url = "?$args";
313
+
314
+ /* Redirect */
315
+ wp_redirect( $url );
316
+
317
+ }
318
+
319
+ /**
320
+ * Adds inline style for non standard notices
321
+ *
322
+ * This function will only be called if the notice style is not standard.
323
+ *
324
+ * @since 0.1.0
325
+ */
326
+ public function style() { ?>
327
+
328
+ <style type="text/css">div.rn-alert{padding:15px;padding-right:35px;margin-bottom:20px;border:1px solid transparent;-webkit-box-shadow:none;box-shadow:none}div.rn-alert p:empty{display:none}div.rn-alert ul,div.rn-alert ul li,div.rn-alert ol,div.rn-alert ol li{list-style:inherit !important}div.rn-alert ul,div.rn-alert ol{padding-left:30px}div.rn-alert hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}div.rn-alert h1,h2,h3,h4,h5,h6{margin-top:0;color:inherit}div.rn-alert a{font-weight:700}div.rn-alert a:hover{text-decoration:underline}div.rn-alert>p{margin:0;padding:0;line-height:1}div.rn-alert>p,div.rn-alert>ul{margin-bottom:0}div.rn-alert>p+p{margin-top:5px}div.rn-alert .rn-dismiss-btn{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;top:-2px;right:-21px;padding:0;cursor:pointer;background:0;border:0;-webkit-appearance:none;float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20);text-decoration:none}div.rn-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}div.rn-alert-success hr{border-top-color:#c9e2b3}div.rn-alert-success a{color:#2b542c}div.rn-alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}div.rn-alert-info hr{border-top-color:#a6e1ec}div.rn-alert-info a{color:#245269}div.rn-alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}div.rn-alert-warning hr{border-top-color:#f7e1b5}div.rn-alert-warning a{color:#66512c}div.rn-alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}div.rn-alert-danger hr{border-top-color:#e4b9c0}div.rn-alert-danger a{color:#843534}</style>
329
+
330
+ <?php }
331
+
332
+ /**
333
+ * Dismiss notice using Ajax
334
+ *
335
+ * This function is NOT used. Testing only.
336
+ */
337
+ public function script() {
338
+
339
+ $url = admin_url();
340
+ ?>
341
+
342
+ <script type="text/javascript">
343
+ jQuery(document).ready(function($) {
344
+
345
+ var prout = 'prout';
346
+
347
+ $('#rn-dismiss').on('click', function(event) {
348
+ event.preventDefault();
349
+ $.ajax({
350
+ type: "GET",
351
+ url: <?php echo $url; ?>,
352
+ data: prout
353
+ });
354
+ console.log('clicked');
355
+ });
356
+
357
+ return false;
358
+
359
+ });
360
+ </script>
361
+
362
+ <?php
363
+
364
+ }
365
+
366
+ /**
367
+ * Debug info.
368
+ *
369
+ * Display an error message commented in the admin footer.
370
+ *
371
+ * @since 0.1.2
372
+ */
373
+ public function debug_info() {
374
+
375
+ $error = $this->error;
376
+
377
+ echo "<!-- RDN Debug Info: $error -->";
378
+
379
+ }
380
+
381
  }
inc/core.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
- if (!class_exists('CWP_PR_PRO_Core')){
3
- class CWP_PR_PRO_Core {
4
-
5
- // All fields
6
-
7
-
8
- public function __construct() {
9
- // Get all fields
10
- //global $cwp_top_fields;
11
-
12
- // Set all authentication settings
13
- $this->loadAllHooks();
14
-
15
- }
16
-
17
- public function addLocalization() {
18
-
19
- load_plugin_textdomain(CWP_TEXTDOMAIN, false, dirname(ROPPLUGINBASENAME).'/languages/');
20
- }
21
-
22
- public function preload_js() {
23
-
24
- // Register & enqueue the preload js script.
25
- wp_register_script("cwp-review-preload", plugins_url( 'cwp-review-preload.php', __FILE__ ), false, "1.0", "all");
26
- wp_enqueue_script("cwp-review-preload");
27
-
28
-
29
- }
30
-
31
- public function loadAllHooks()
32
- {
33
- //add_action( 'plugins_loaded', array($this, 'addLocalization') );
34
- add_action( 'admin_enqueue_scripts', array($this, "preload_js"));
35
- }
36
-
37
-
38
-
39
- }
40
- }
41
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp-review-preload.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
- require_once( '../../../../wp-load.php' );
3
- header("Content-type: text/javascript", true);
4
- ?>
5
-
6
- jQuery(document).ready(function(){
7
- function cwpPreloadOptions(item) {
8
- for (var i = 1; i <= 5; i++) {
9
- var preloadListItem = jQuery(item).parent().parent().children(".cwp_pitem_info").children(".cwp_pitem_options_content").children("li:eq("+(i-1)+")").text();
10
- if(preloadListItem != "-") { jQuery("input#option_" + i + "_content").val(preloadListItem); }
11
- };
12
- }
13
-
14
- function cwpPreloadCons(item)
15
- {
16
- for (var i = 1; i <= 5; i++) {
17
- var preloadListItem = jQuery(item).parent().parent().children(".cwp_pitem_info").children(".cwp_pitem_options_pros").children("li:eq("+(i-1)+")").text();
18
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + i + "_pro").val(preloadListItem); }
19
- };
20
- }
21
-
22
- function cwpPreloadPros(item)
23
- {
24
- for (var i = 1; i <= 5; i++) {
25
- var preloadListItem = jQuery(item).parent().parent().children(".cwp_pitem_info").children(".cwp_pitem_options_cons").children("li:eq("+(i-1)+")").text();
26
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + i + "_cons").val(preloadListItem); }
27
- };
28
- }
29
- jQuery(".preload_info").click(function(e){
30
- e.preventDefault();
31
-
32
- var cwpThemeUrl = '<?php echo plugins_url( '', __FILE__ ); ?>';
33
- var ajaxLoad = "<img class='ajax_load_icon' src='" + cwpThemeUrl +"/images/ajaxload.gif' alt='Loading...'/>";
34
- var loadUrl = cwpThemeUrl + "/review-preloader.php";
35
-
36
- jQuery("body #wpwrap").append("<div class='preload_result'><div class='preload_inner'><header><h2>Preload Info</h2><div class='preload_close'></div></header><div class='preloader_body'><ul class='preload_list'></ul></div></div></div>");
37
- jQuery(".preload_result").fadeIn();
38
-
39
- jQuery(".preload_close").bind("click", function(){
40
- jQuery(".preload_result").fadeOut();
41
- });
42
-
43
- jQuery(".preload_list").html(ajaxLoad).load(loadUrl);
44
-
45
-
46
- jQuery(".preload_list .cwp_p_title").live("click", function(){
47
- jQuery(this).parent().parent().children(".cwp_pitem_info").slideToggle();
48
- });
49
-
50
- jQuery(".preload_list li button.preload").live("click", function(){
51
- cwpPreloadOptions(this);
52
- cwpPreloadCons(this);
53
- cwpPreloadPros(this);
54
- jQuery(".preload_result").fadeOut();
55
- });
56
-
57
- jQuery(".preload_list .cwp_pitem_options_content li").live("click",function(){
58
- var plIndex = jQuery(this).index();
59
- var preloadListItem = jQuery(this).text();
60
- if(preloadListItem != "-") { jQuery("input#option_" + plIndex + "_content").val(preloadListItem); }
61
- });
62
-
63
- jQuery(".preload_list .cwp_pitem_options_pros li").live("click",function(){
64
- var plIndex = jQuery(this).index();
65
- var preloadListItem = jQuery(this).text();
66
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + plIndex + "_pro").val(preloadListItem); }
67
- });
68
-
69
- jQuery(".preload_list .cwp_pitem_options_cons li").live("click",function(){
70
- var plIndex = jQuery(this).index();
71
- var preloadListItem = jQuery(this).text();
72
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + plIndex + "_cons").val(preloadListItem); }
73
- });
74
-
75
- });
76
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_frontpage.php CHANGED
@@ -1 +1 @@
1
- <?php
2
 
3
  <div class="review-wrap-up hreview clearfix">
4
  <div class="review-top clearfix">
5
  <h2 class="item" itemprop="itemreviewed">'.get_post_meta($post->ID, "cwp_rev_product_name", true).'</h2>
6
  </div><!-- end .review-top -->
7
  <div class="review-wu-left">
8
  <div class="rev-wu-image">';
9
 
10
  $product_image = get_post_meta($post->ID, "cwp_rev_product_image", true);
11
  if(!empty($product_image)) {
12
  $return_string .= "<p class='no-featured-image'>".__("No image added.", "cwppos")."</p>";
13
  }
14
 
15
  for($i=1; $i<6; $i++) {
16
  ${"option".$i."_grade"} = get_post_meta($post->ID, "option_".$i."_grade", true);
17
  }
18
 
19
  for($i=1; $i<6; $i++) {
20
  ${"option".$i."_content"} = get_post_meta($post->ID, "option_".$i."_content", true);
21
  if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwppos"); }
22
  } ?>
23
  <?php $commentNr = get_comments_number($post->ID) + 2;
24
  $return_string .= '</div><!-- end .rev-wu-image -->
25
  <div class="review-wu-grade">
26
  <div class="cwp-review-chart">
27
  <meta itemprop="dtreviewed" datetime="'.get_the_time("Y-m-d", $post->ID).'">
28
  <meta itemprop="reviewer" content="'.get_the_author($post->ID).'">
29
  <meta itemprop="count" content="'.$commentNr.'">
30
  <div temprop="reviewRating" itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating" class="cwp-review-percentage" data-percent="';
31
  $overall_score = "";
32
  $iter = 0;
33
  if(!empty($option1_grade) || $option1_grade === '0') { $overall_score += $option1_grade; $iter++; }
34
  if(!empty($option2_grade) || $option2_grade === '0' ) { $overall_score += $option2_grade; $iter++; }
35
  if(!empty($option3_grade) || $option3_grade === '0' ) { $overall_score += $option3_grade; $iter++; }
36
  if(!empty($option4_grade) || $option4_grade === '0' ) { $overall_score += $option4_grade; $iter++; }
37
  if(!empty($option5_grade) || $option5_grade === '0' ) { $overall_score += $option5_grade; $iter++; }
38
  //update_post_meta($post->ID, 'option_overall_score', $overall_score/10);
39
  //update_option("option_overall_score",$overall_score);
40
  $return_string .= $overall_score.'"><span itemprop="value" class="cwp-review-rating">'.round($overall_score/10).'</span><meta itemprop="best" content = "10"/></div>
41
  </div><!-- end .chart -->
42
  </div><!-- end .review-wu-grade -->
43
  <div class="review-wu-bars">';
44
  if (!empty($option1_content) && (!empty($option1_grade) || $option1_grade === '0' ) && strtoupper($option1_content) != 'DEFAULT FEATURE 1') {
45
  $return_string .= '<div class="rev-option" data-value='.$option1_grade.'>
46
  <div class="clearfix">
47
  <h3>'. $option1_content.'</h3>
48
  <span>'.$option1_grade.'/10</span>
49
  </div>
50
  <ul class="clearfix"></ul>
51
  </div>';
52
  }
53
 
54
  if (!empty($option2_content) && (!empty($option2_grade) || $option2_grade==='0' ) && strtoupper($option2_content) != 'DEFAULT FEATURE 2') {
55
  $return_string .= '<div class="rev-option" data-value='.$option2_grade.'>
56
  <div class="clearfix">
57
  <h3>'. $option2_content.'</h3>
58
  <span>'.$option2_grade.'/10</span>
59
  </div>
60
  <ul class="clearfix"></ul>
61
  </div>';
62
  }
63
 
64
  if (!empty($option3_content) && (!empty($option3_grade) || $option3_grade === '0') && strtoupper($option3_content) != 'DEFAULT FEATURE 3') {
65
  $return_string .= '<div class="rev-option" data-value='.$option3_grade.'>
66
  <div class="clearfix">
67
  <h3>'. $option3_content.'</h3>
68
  <span>'.$option3_grade.'/10</span>
69
  </div>
70
  <ul class="clearfix"></ul>
71
  </div>';
72
  }
73
 
74
  if (!empty($option4_content) && (!empty($option4_grade) || $option4_grade === '0') && strtoupper($option4_content) != 'DEFAULT FEATURE 4') {
75
  $return_string .= '<div class="rev-option" data-value='.$option4_grade.'>
76
  <div class="clearfix">
77
  <h3>'. $option4_content.'</h3>
78
  <span>'.$option4_grade.'/10</span>
79
  </div>
80
  <ul class="clearfix"></ul>
81
  </div>';
82
  }
83
  if (!empty($option5_content) && (!empty($option5_grade) || $option5_grade==='0') && strtoupper($option5_content) != 'DEFAULT FEATURE 5') {
84
  $return_string .= '<div class="rev-option" data-value='.$option5_grade.'>
85
  <div class="clearfix">
86
  <h3>'. $option5_content.'</h3>
87
  <span>'.$option5_grade.'/10</span>
88
  </div>
89
  <ul class="clearfix"></ul>
90
  </div>';
91
  $return_string .='
92
  </div><!-- end .review-wu-bars -->
93
  </div><!-- end .review-wu-left -->
94
  <div class="review-wu-right">
95
  <div class="pros">';
96
 
97
 
98
 
99
  for($i=1; $i<6; $i++) {
100
  ${"pro_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_pro", true);
101
  }
102
  for($i=1; $i<6; $i++) {
103
  ${"cons_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_cons", true); if(empty(${"cons_option_".$i})) { ${"cons_option_".$i} = ""; }
104
  }
105
 
106
  $return_string .= '<h2>'.__(cwppos("cwppos_pros_text"), "cwppos").'</h2>
107
  <ul>';
108
  }
109
  $return_string .= ' </ul>
110
  </div><!-- end .pros -->
111
  <div class="cons">';
112
  $return_string .=' <h2>'.__(cwppos("cwppos_cons_text"), "cwppos").'</h2> <ul>';
113
  </ul>
114
  </div>';
115
 
116
 
117
 
118
  $return_string .='
119
  </div><!-- end .review-wu-right -->
120
  </div><!-- end .review-wrap-up -->
121
  </section><!-- end #review-statistics -->';
122
  $return_string.='<p style="float:right;">Powered by <a href="http://wordpress.org/plugins/wp-product-review/" target="_blank" rel="nofollow" > WP Product Review</a></p>';
123
  }
124
  $affiliate_text = get_post_meta($post->ID, "cwp_product_affiliate_text", true);
125
  $affiliate_link = get_post_meta($post->ID, "cwp_product_affiliate_link", true);
126
  if(!empty($affiliate_text) && !empty($affiliate_link)) {
127
 
128
 
129
  $return_string .= '<div class="affiliate-button">
130
  <a href="'.$affiliate_link.'" rel="nofollow" target="_blank"><span>'. $affiliate_text.'</span> </a>
131
  </div><!-- end .affiliate-button -->';
132
 
133
  if ($currentTheme->get('Name') !== 'Bookrev') {
134
  add_filter('the_content', 'cwp_pac_before_content');
135
  }
 
136
 
137
  <div class="review-wrap-up hreview clearfix">
138
  <div class="review-top clearfix">
139
  <h2 class="item" itemprop="itemreviewed">'.get_post_meta($post->ID, "cwp_rev_product_name", true).'</h2>
140
  </div><!-- end .review-top -->
141
  <div class="review-wu-left">
142
  <div class="rev-wu-image">';
143
 
144
  $product_image = get_post_meta($post->ID, "cwp_rev_product_image", true);
145
  if(!empty($product_image)) {
146
  $return_string .= "<p class='no-featured-image'>".__("No image added.", "cwp")."</p>";
147
  }
148
 
149
  for($i=1; $i<6; $i++) {
150
  ${"option".$i."_grade"} = get_post_meta($post->ID, "option_".$i."_grade", true);
151
  }
152
 
153
  for($i=1; $i<6; $i++) {
154
  ${"option".$i."_content"} = get_post_meta($post->ID, "option_".$i."_content", true);
155
  if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwp"); }
156
  } ?>
157
  <?php $commentNr = get_comments_number($post->ID) + 2;
158
  $return_string .= '</div><!-- end .rev-wu-image -->
159
  <div class="review-wu-grade">
160
  <div class="cwp-review-chart">
161
  <meta itemprop="dtreviewed" datetime="'.get_the_time("Y-m-d", $post->ID).'">
162
  <meta itemprop="reviewer" content="'.get_the_author($post->ID).'">
163
  <meta itemprop="count" content="'.$commentNr.'">
164
  <div temprop="reviewRating" itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating" class="cwp-review-percentage" data-percent="';
165
  $overall_score = "";
166
  $iter = 0;
167
  if(!empty($option1_grade)) { $overall_score += $option1_grade; $iter++; }
168
  if(!empty($option2_grade)) { $overall_score += $option2_grade; $iter++; }
169
  if(!empty($option3_grade)) { $overall_score += $option3_grade; $iter++; }
170
  if(!empty($option4_grade)) { $overall_score += $option4_grade; $iter++; }
171
  if(!empty($option5_grade)) { $overall_score += $option5_grade; $iter++; }
172
  update_post_meta($post->ID, 'option_overall_score', $overall_score/10);
173
  //update_option("option_overall_score",$overall_score);
174
  $return_string .= $overall_score.'"><span itemprop="value" class="cwp-review-rating">'.round($overall_score/10).'</span><meta itemprop="best" content = "10"/></div>
175
  </div><!-- end .chart -->
176
  </div><!-- end .review-wu-grade -->
177
  <div class="review-wu-bars">';
178
  if (!empty($option1_content) && !empty($option1_grade) && strtoupper($option1_content) != 'DEFAULT FEATURE 1') {
179
  $return_string .= '<div class="rev-option" data-value='.$option1_grade.'>
180
  <div class="clearfix">
181
  <h3>'. $option1_content.'</h3>
182
  <span>'.$option1_grade.'/10</span>
183
  </div>
184
  <ul class="clearfix"></ul>
185
  </div>';
186
  }
187
 
188
  if (!empty($option2_content) && !empty($option2_grade) && strtoupper($option2_content) != 'DEFAULT FEATURE 2') {
189
  $return_string .= '<div class="rev-option" data-value='.$option2_grade.'>
190
  <div class="clearfix">
191
  <h3>'. $option2_content.'</h3>
192
  <span>'.$option2_grade.'/10</span>
193
  </div>
194
  <ul class="clearfix"></ul>
195
  </div>';
196
  }
197
 
198
  if (!empty($option3_content) && !empty($option3_grade)&& strtoupper($option3_content) != 'DEFAULT FEATURE 3') {
199
  $return_string .= '<div class="rev-option" data-value='.$option3_grade.'>
200
  <div class="clearfix">
201
  <h3>'. $option3_content.'</h3>
202
  <span>'.$option3_grade.'/10</span>
203
  </div>
204
  <ul class="clearfix"></ul>
205
  </div>';
206
  }
207
 
208
  if (!empty($option4_content) && !empty($option4_grade) && strtoupper($option4_content) != 'DEFAULT FEATURE 4') {
209
  $return_string .= '<div class="rev-option" data-value='.$option4_grade.'>
210
  <div class="clearfix">
211
  <h3>'. $option4_content.'</h3>
212
  <span>'.$option4_grade.'/10</span>
213
  </div>
214
  <ul class="clearfix"></ul>
215
  </div>';
216
  }
217
  if (!empty($option5_content) && !empty($option5_grade) && strtoupper($option5_content) != 'DEFAULT FEATURE 5') {
218
  $return_string .= '<div class="rev-option" data-value='.$option5_grade.'>
219
  <div class="clearfix">
220
  <h3>'. $option5_content.'</h3>
221
  <span>'.$option5_grade.'/10</span>
222
  </div>
223
  <ul class="clearfix"></ul>
224
  </div>';
225
  $return_string .='
226
  </div><!-- end .review-wu-bars -->
227
  </div><!-- end .review-wu-left -->
228
  <div class="review-wu-right">
229
  <div class="pros">';
230
 
231
 
232
 
233
  for($i=1; $i<6; $i++) {
234
  ${"pro_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_pro", true);
235
  }
236
  for($i=1; $i<6; $i++) {
237
  ${"cons_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_cons", true); if(empty(${"cons_option_".$i})) { ${"cons_option_".$i} = ""; }
238
  }
239
 
240
  $return_string .= '<h2>'.__(cwppos("cwppos_pros_text"), "cwp").'</h2>
241
  <ul>';
242
  }
243
  $return_string .= ' </ul>
244
  </div><!-- end .pros -->
245
  <div class="cons">';
246
  $return_string .=' <h2>'.__(cwppos("cwppos_cons_text"), "cwp").'</h2> <ul>';
247
  </ul>
248
  </div><!-- end .pros -->
249
  </div><!-- end .review-wu-right -->
250
  </div><!-- end .review-wrap-up -->
251
  </section><!-- end #review-statistics -->';
252
  $affiliate_text = get_post_meta($post->ID, "cwp_product_affiliate_text", true);
253
  $affiliate_link = get_post_meta($post->ID, "cwp_product_affiliate_link", true);
254
  if(!empty($affiliate_text) && !empty($affiliate_link)) {
255
 
256
 
257
  $return_string .= '<div class="affiliate-button">
258
  <a href="'.$affiliate_link.'" rel="nofollow" target="_blank"><span>'. $affiliate_text.'</span> </a>
259
  </div><!-- end .affiliate-button -->';
 
1
 
2
  <div class="review-wrap-up hreview clearfix">
3
  <div class="review-top clearfix">
4
  <h2 class="item" itemprop="itemreviewed">'.get_post_meta($post->ID, "cwp_rev_product_name", true).'</h2>
5
  </div><!-- end .review-top -->
6
  <div class="review-wu-left">
7
  <div class="rev-wu-image">';
8
 
9
  $product_image = get_post_meta($post->ID, "cwp_rev_product_image", true);
10
  if(!empty($product_image)) {
11
  $return_string .= "<p class='no-featured-image'>".__("No image added.", "cwppos")."</p>";
12
  }
13
 
14
  for($i=1; $i<6; $i++) {
15
  ${"option".$i."_grade"} = get_post_meta($post->ID, "option_".$i."_grade", true);
16
  }
17
 
18
  for($i=1; $i<6; $i++) {
19
  ${"option".$i."_content"} = get_post_meta($post->ID, "option_".$i."_content", true);
20
  if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwppos"); }
21
  } ?>
22
  <?php $commentNr = get_comments_number($post->ID) + 2;
23
  $return_string .= '</div><!-- end .rev-wu-image -->
24
  <div class="review-wu-grade">
25
  <div class="cwp-review-chart">
26
  <meta itemprop="dtreviewed" datetime="'.get_the_time("Y-m-d", $post->ID).'">
27
  <meta itemprop="reviewer" content="'.get_the_author($post->ID).'">
28
  <meta itemprop="count" content="'.$commentNr.'">
29
  <div temprop="reviewRating" itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating" class="cwp-review-percentage" data-percent="';
30
  $overall_score = "";
31
  $iter = 0;
32
  if(!empty($option1_grade) || $option1_grade === '0') { $overall_score += $option1_grade; $iter++; }
33
  if(!empty($option2_grade) || $option2_grade === '0' ) { $overall_score += $option2_grade; $iter++; }
34
  if(!empty($option3_grade) || $option3_grade === '0' ) { $overall_score += $option3_grade; $iter++; }
35
  if(!empty($option4_grade) || $option4_grade === '0' ) { $overall_score += $option4_grade; $iter++; }
36
  if(!empty($option5_grade) || $option5_grade === '0' ) { $overall_score += $option5_grade; $iter++; }
37
  //update_post_meta($post->ID, 'option_overall_score', $overall_score/10);
38
  //update_option("option_overall_score",$overall_score);
39
  $return_string .= $overall_score.'"><span itemprop="value" class="cwp-review-rating">'.round($overall_score/10).'</span><meta itemprop="best" content = "10"/></div>
40
  </div><!-- end .chart -->
41
  </div><!-- end .review-wu-grade -->
42
  <div class="review-wu-bars">';
43
  if (!empty($option1_content) && (!empty($option1_grade) || $option1_grade === '0' ) && strtoupper($option1_content) != 'DEFAULT FEATURE 1') {
44
  $return_string .= '<div class="rev-option" data-value='.$option1_grade.'>
45
  <div class="clearfix">
46
  <h3>'. $option1_content.'</h3>
47
  <span>'.$option1_grade.'/10</span>
48
  </div>
49
  <ul class="clearfix"></ul>
50
  </div>';
51
  }
52
 
53
  if (!empty($option2_content) && (!empty($option2_grade) || $option2_grade==='0' ) && strtoupper($option2_content) != 'DEFAULT FEATURE 2') {
54
  $return_string .= '<div class="rev-option" data-value='.$option2_grade.'>
55
  <div class="clearfix">
56
  <h3>'. $option2_content.'</h3>
57
  <span>'.$option2_grade.'/10</span>
58
  </div>
59
  <ul class="clearfix"></ul>
60
  </div>';
61
  }
62
 
63
  if (!empty($option3_content) && (!empty($option3_grade) || $option3_grade === '0') && strtoupper($option3_content) != 'DEFAULT FEATURE 3') {
64
  $return_string .= '<div class="rev-option" data-value='.$option3_grade.'>
65
  <div class="clearfix">
66
  <h3>'. $option3_content.'</h3>
67
  <span>'.$option3_grade.'/10</span>
68
  </div>
69
  <ul class="clearfix"></ul>
70
  </div>';
71
  }
72
 
73
  if (!empty($option4_content) && (!empty($option4_grade) || $option4_grade === '0') && strtoupper($option4_content) != 'DEFAULT FEATURE 4') {
74
  $return_string .= '<div class="rev-option" data-value='.$option4_grade.'>
75
  <div class="clearfix">
76
  <h3>'. $option4_content.'</h3>
77
  <span>'.$option4_grade.'/10</span>
78
  </div>
79
  <ul class="clearfix"></ul>
80
  </div>';
81
  }
82
  if (!empty($option5_content) && (!empty($option5_grade) || $option5_grade==='0') && strtoupper($option5_content) != 'DEFAULT FEATURE 5') {
83
  $return_string .= '<div class="rev-option" data-value='.$option5_grade.'>
84
  <div class="clearfix">
85
  <h3>'. $option5_content.'</h3>
86
  <span>'.$option5_grade.'/10</span>
87
  </div>
88
  <ul class="clearfix"></ul>
89
  </div>';
90
  $return_string .='
91
  </div><!-- end .review-wu-bars -->
92
  </div><!-- end .review-wu-left -->
93
  <div class="review-wu-right">
94
  <div class="pros">';
95
 
96
 
97
 
98
  for($i=1; $i<6; $i++) {
99
  ${"pro_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_pro", true);
100
  }
101
  for($i=1; $i<6; $i++) {
102
  ${"cons_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_cons", true); if(empty(${"cons_option_".$i})) { ${"cons_option_".$i} = ""; }
103
  }
104
 
105
  $return_string .= '<h2>'.__(cwppos("cwppos_pros_text"), "cwppos").'</h2>
106
  <ul>';
107
  }
108
  $return_string .= ' </ul>
109
  </div><!-- end .pros -->
110
  <div class="cons">';
111
  $return_string .=' <h2>'.__(cwppos("cwppos_cons_text"), "cwppos").'</h2> <ul>';
112
  </ul>
113
  </div>';
114
 
115
 
116
 
117
  $return_string .='
118
  </div><!-- end .review-wu-right -->
119
  </div><!-- end .review-wrap-up -->
120
  </section><!-- end #review-statistics -->';
121
  $return_string.='<p style="float:right;">Powered by <a href="http://wordpress.org/plugins/wp-product-review/" target="_blank" rel="nofollow" > WP Product Review</a></p>';
122
  }
123
  $affiliate_text = get_post_meta($post->ID, "cwp_product_affiliate_text", true);
124
  $affiliate_link = get_post_meta($post->ID, "cwp_product_affiliate_link", true);
125
  if(!empty($affiliate_text) && !empty($affiliate_link)) {
126
 
127
 
128
  $return_string .= '<div class="affiliate-button">
129
  <a href="'.$affiliate_link.'" rel="nofollow" target="_blank"><span>'. $affiliate_text.'</span> </a>
130
  </div><!-- end .affiliate-button -->';
131
 
132
  if ($currentTheme->get('Name') !== 'Bookrev') {
133
  add_filter('the_content', 'cwp_pac_before_content');
134
  }
135
+ <?php
136
 
137
  <div class="review-wrap-up hreview clearfix">
138
  <div class="review-top clearfix">
139
  <h2 class="item" itemprop="itemreviewed">'.get_post_meta($post->ID, "cwp_rev_product_name", true).'</h2>
140
  </div><!-- end .review-top -->
141
  <div class="review-wu-left">
142
  <div class="rev-wu-image">';
143
 
144
  $product_image = get_post_meta($post->ID, "cwp_rev_product_image", true);
145
  if(!empty($product_image)) {
146
  $return_string .= "<p class='no-featured-image'>".__("No image added.", "cwp")."</p>";
147
  }
148
 
149
  for($i=1; $i<6; $i++) {
150
  ${"option".$i."_grade"} = get_post_meta($post->ID, "option_".$i."_grade", true);
151
  }
152
 
153
  for($i=1; $i<6; $i++) {
154
  ${"option".$i."_content"} = get_post_meta($post->ID, "option_".$i."_content", true);
155
  if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwp"); }
156
  } ?>
157
  <?php $commentNr = get_comments_number($post->ID) + 2;
158
  $return_string .= '</div><!-- end .rev-wu-image -->
159
  <div class="review-wu-grade">
160
  <div class="cwp-review-chart">
161
  <meta itemprop="dtreviewed" datetime="'.get_the_time("Y-m-d", $post->ID).'">
162
  <meta itemprop="reviewer" content="'.get_the_author($post->ID).'">
163
  <meta itemprop="count" content="'.$commentNr.'">
164
  <div temprop="reviewRating" itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating" class="cwp-review-percentage" data-percent="';
165
  $overall_score = "";
166
  $iter = 0;
167
  if(!empty($option1_grade)) { $overall_score += $option1_grade; $iter++; }
168
  if(!empty($option2_grade)) { $overall_score += $option2_grade; $iter++; }
169
  if(!empty($option3_grade)) { $overall_score += $option3_grade; $iter++; }
170
  if(!empty($option4_grade)) { $overall_score += $option4_grade; $iter++; }
171
  if(!empty($option5_grade)) { $overall_score += $option5_grade; $iter++; }
172
  update_post_meta($post->ID, 'option_overall_score', $overall_score/10);
173
  //update_option("option_overall_score",$overall_score);
174
  $return_string .= $overall_score.'"><span itemprop="value" class="cwp-review-rating">'.round($overall_score/10).'</span><meta itemprop="best" content = "10"/></div>
175
  </div><!-- end .chart -->
176
  </div><!-- end .review-wu-grade -->
177
  <div class="review-wu-bars">';
178
  if (!empty($option1_content) && !empty($option1_grade) && strtoupper($option1_content) != 'DEFAULT FEATURE 1') {
179
  $return_string .= '<div class="rev-option" data-value='.$option1_grade.'>
180
  <div class="clearfix">
181
  <h3>'. $option1_content.'</h3>
182
  <span>'.$option1_grade.'/10</span>
183
  </div>
184
  <ul class="clearfix"></ul>
185
  </div>';
186
  }
187
 
188
  if (!empty($option2_content) && !empty($option2_grade) && strtoupper($option2_content) != 'DEFAULT FEATURE 2') {
189
  $return_string .= '<div class="rev-option" data-value='.$option2_grade.'>
190
  <div class="clearfix">
191
  <h3>'. $option2_content.'</h3>
192
  <span>'.$option2_grade.'/10</span>
193
  </div>
194
  <ul class="clearfix"></ul>
195
  </div>';
196
  }
197
 
198
  if (!empty($option3_content) && !empty($option3_grade)&& strtoupper($option3_content) != 'DEFAULT FEATURE 3') {
199
  $return_string .= '<div class="rev-option" data-value='.$option3_grade.'>
200
  <div class="clearfix">
201
  <h3>'. $option3_content.'</h3>
202
  <span>'.$option3_grade.'/10</span>
203
  </div>
204
  <ul class="clearfix"></ul>
205
  </div>';
206
  }
207
 
208
  if (!empty($option4_content) && !empty($option4_grade) && strtoupper($option4_content) != 'DEFAULT FEATURE 4') {
209
  $return_string .= '<div class="rev-option" data-value='.$option4_grade.'>
210
  <div class="clearfix">
211
  <h3>'. $option4_content.'</h3>
212
  <span>'.$option4_grade.'/10</span>
213
  </div>
214
  <ul class="clearfix"></ul>
215
  </div>';
216
  }
217
  if (!empty($option5_content) && !empty($option5_grade) && strtoupper($option5_content) != 'DEFAULT FEATURE 5') {
218
  $return_string .= '<div class="rev-option" data-value='.$option5_grade.'>
219
  <div class="clearfix">
220
  <h3>'. $option5_content.'</h3>
221
  <span>'.$option5_grade.'/10</span>
222
  </div>
223
  <ul class="clearfix"></ul>
224
  </div>';
225
  $return_string .='
226
  </div><!-- end .review-wu-bars -->
227
  </div><!-- end .review-wu-left -->
228
  <div class="review-wu-right">
229
  <div class="pros">';
230
 
231
 
232
 
233
  for($i=1; $i<6; $i++) {
234
  ${"pro_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_pro", true);
235
  }
236
  for($i=1; $i<6; $i++) {
237
  ${"cons_option_".$i} = get_post_meta($post->ID, "cwp_option_".$i."_cons", true); if(empty(${"cons_option_".$i})) { ${"cons_option_".$i} = ""; }
238
  }
239
 
240
  $return_string .= '<h2>'.__(cwppos("cwppos_pros_text"), "cwp").'</h2>
241
  <ul>';
242
  }
243
  $return_string .= ' </ul>
244
  </div><!-- end .pros -->
245
  <div class="cons">';
246
  $return_string .=' <h2>'.__(cwppos("cwppos_cons_text"), "cwp").'</h2> <ul>';
247
  </ul>
248
  </div><!-- end .pros -->
249
  </div><!-- end .review-wu-right -->
250
  </div><!-- end .review-wrap-up -->
251
  </section><!-- end #review-statistics -->';
252
  $affiliate_text = get_post_meta($post->ID, "cwp_product_affiliate_text", true);
253
  $affiliate_link = get_post_meta($post->ID, "cwp_product_affiliate_link", true);
254
  if(!empty($affiliate_text) && !empty($affiliate_link)) {
255
 
256
 
257
  $return_string .= '<div class="affiliate-button">
258
  <a href="'.$affiliate_link.'" rel="nofollow" target="_blank"><span>'. $affiliate_text.'</span> </a>
259
  </div><!-- end .affiliate-button -->';
inc/cwp_metabox.php CHANGED
@@ -56,9 +56,9 @@ function cwp_review_meta_box_callback( $post )
56
 
57
  <div class="review-settings-notice">
58
 
59
- <h4><?php _e("Product Details", "cwppos"); ?></h4>
60
 
61
- <p style="margin:0;"><?php _e("Specify the general details for the reviewed product.", "cwppos"); ?></p>
62
 
63
 
64
 
@@ -72,7 +72,7 @@ function cwp_review_meta_box_callback( $post )
72
 
73
  <li>
74
 
75
- <label for="cwp_rev_product_name"><?php _e("Product Name", "cwppos"); ?></label>
76
 
77
  <input type="text" name="cwp_rev_product_name" id="cwp_rev_product_name" value="<?php if(isset($cwp_review_stored_meta['cwp_rev_product_name'][0])) { echo $cwp_review_stored_meta['cwp_rev_product_name'][0]; }?>"/>
78
 
@@ -85,7 +85,7 @@ function cwp_review_meta_box_callback( $post )
85
  <label for="cwp_rev_product_image" class="cwp_rev_product_image-title"><?php _e( 'Product Image', 'cwp' )?></label>
86
  <input type="text" name="cwp_rev_product_image" id="cwp_rev_product_image" value="<?php if ( isset ( $cwp_review_stored_meta['cwp_rev_product_image'][0] ) ) echo $cwp_review_stored_meta['cwp_rev_product_image'][0]; ?>" />
87
  <input type="button" id="cwp_rev_product_image-button" class="button" value="<?php _e( 'Choose or Upload an Image', 'cwp' )?>" />
88
- <p><?php if (cwppos("cwppos_show_poweredby") == 'no' && !class_exists('CWP_PR_PRO_Core')) { ?> <del> <?php _e("*If no image is provided, featured image is used","cwppos");?> </del> <span style="color:red;"><?php _e("This is only available in the PRO version.","cwppos");?></span> <?php } else _e("*If no image is provided, featured image is used");?>
89
 
90
 
91
 
@@ -95,7 +95,7 @@ function cwp_review_meta_box_callback( $post )
95
 
96
  <li>
97
 
98
- <label for="cwp_product_affiliate_text"><?php _e("Affiliate Button Text", "cwppos"); ?></label>
99
 
100
  <input type="text" name="cwp_product_affiliate_text" id="cwp_product_affiliate_text" value="<?php if(isset($cwp_review_stored_meta['cwp_product_affiliate_text'][0])) { echo $cwp_review_stored_meta['cwp_product_affiliate_text'][0]; } ?>"/>
101
 
@@ -105,7 +105,7 @@ function cwp_review_meta_box_callback( $post )
105
 
106
  <li>
107
 
108
- <label for="cwp_product_affiliate_link"><?php _e("Affiliate Link", "cwppos"); ?></label>
109
 
110
  <input type="text" name="cwp_product_affiliate_link" id="cwp_product_affiliate_link" value="<?php if(isset($cwp_review_stored_meta['cwp_product_affiliate_link'][0])) { echo $cwp_review_stored_meta['cwp_product_affiliate_link'][0]; } ?>"/>
111
 
@@ -122,17 +122,14 @@ function cwp_review_meta_box_callback( $post )
122
 
123
 
124
  <div class="review-settings-notice">
125
- <h4><?php _e("Product Options Setting", "cwppos"); ?></h4>
126
- <div class="preloadInfo"><?php _e("Insert your options and their grades. Grading must be done <b><i>from 0 to 100</i></b>. In order to be able to automatically preload your settings from another posts, you need to <a href='http://www.readythemes.com/wp-product-review-pro/' target='_blank'>Upgrade to PRO</a>.", "cwppos"); ?></div>
127
- <?php if(cwppos("cwppos_show_poweredby") === 'yes' || class_exists('CWP_PR_PRO_Core')) { ?>
128
- <a href="#" class="preload_info"><?php _e("Preload Info","cwppos");?></a>
129
- <?php } else {
130
- $pageURL = admin_url('admin.php?page=cwppos_options#tab-upgrade_to_pro');
131
- $pageURL = str_replace(":80","",$pageURL);
132
- ?>
133
- <a href="<?php echo $pageURL;?>" target="_blank" class="preload_info"><?php _e("Preload Info","cwppos");?></a>
134
- <?php } ?>
135
- </div><!-- end .review-settings-notice -->
136
 
137
  <div class="review-settings-group">
138
 
@@ -202,9 +199,9 @@ function cwp_review_meta_box_callback( $post )
202
 
203
  <div class="review-settings-notice">
204
 
205
- <h4><?php _e("Pro Features", "cwppos"); ?></h4>
206
 
207
- <p style="margin:0;"><?php _e("Insert product's pro features below.", "cwppos"); ?></p>
208
 
209
  </div><!-- end .review-settings-notice -->
210
 
@@ -276,9 +273,9 @@ function cwp_review_meta_box_callback( $post )
276
 
277
  <div class="review-settings-notice">
278
 
279
- <h4><?php _e("Cons Features", "cwppos"); ?></h4>
280
 
281
- <p style="margin:0;"><?php _e("Insert product's cons features below.", "cwppos"); ?></p>
282
 
283
  </div><!-- end .review-settings-notice -->
284
 
@@ -492,25 +489,10 @@ function cwp_review_meta_boxes_save($post_id)
492
 
493
 
494
 
495
- if( isset( $_POST[ 'cwp_rev_product_image' ] )&&$_POST[ 'cwp_rev_product_image' ] !="" ) {
496
 
497
  update_post_meta( $post_id, 'cwp_rev_product_image', sanitize_text_field( $_POST[ 'cwp_rev_product_image' ] ) );
498
 
499
- } elseif (cwppos("cwppos_show_poweredby") == 'yes' || class_exists('CWP_PR_PRO_Core')) {
500
- $image="";
501
- if ( strlen( $img = get_the_post_thumbnail( $post_id, array( 150, 150 ) ) ) ) :
502
- $image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'optional-size' );
503
- $image = $image_array[0];
504
- else :
505
- $post = get_post($post_id);
506
- $image = '';
507
- ob_start();
508
- ob_end_clean();
509
- $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
510
-
511
- $image = $matches [1] [0];
512
- endif;
513
- update_post_meta( $post_id, 'cwp_rev_product_image', $image );
514
  }
515
 
516
 
@@ -593,34 +575,6 @@ function cwp_review_meta_boxes_save($post_id)
593
 
594
  }
595
 
596
- for($i=1; $i<6; $i++) {
597
-
598
- ${"option".$i."_grade"} = get_post_meta($post_id, "option_".$i."_grade", true);
599
-
600
- }
601
-
602
- $overall_score = "";
603
-
604
- $iter = 0;
605
-
606
- if(!empty($option1_grade) || $option1_grade === '0') { $overall_score += $option1_grade; $iter++; }
607
-
608
- if(!empty($option2_grade) || $option2_grade === '0' ) { $overall_score += $option2_grade; $iter++; }
609
-
610
- if(!empty($option3_grade) || $option3_grade === '0' ) { $overall_score += $option3_grade; $iter++; }
611
-
612
- if(!empty($option4_grade) || $option4_grade === '0' ) { $overall_score += $option4_grade; $iter++; }
613
-
614
- if(!empty($option5_grade) || $option5_grade === '0' ) { $overall_score += $option5_grade; $iter++; }
615
- if($iter == 0){
616
- $overall_score = 0;
617
- }else{
618
- $overall_score = $overall_score / $iter;
619
- }
620
- update_post_meta($post_id, 'option_overall_score', $overall_score/10);
621
-
622
-
623
-
624
  }
625
 
626
 
56
 
57
  <div class="review-settings-notice">
58
 
59
+ <h4><?php _e("Product Details", "cwp"); ?></h4>
60
 
61
+ <p style="margin:0;"><?php _e("Specify the general details for the reviewed product.", "cwp"); ?></p>
62
 
63
 
64
 
72
 
73
  <li>
74
 
75
+ <label for="cwp_rev_product_name"><?php _e("Product Name", "cwp"); ?></label>
76
 
77
  <input type="text" name="cwp_rev_product_name" id="cwp_rev_product_name" value="<?php if(isset($cwp_review_stored_meta['cwp_rev_product_name'][0])) { echo $cwp_review_stored_meta['cwp_rev_product_name'][0]; }?>"/>
78
 
85
  <label for="cwp_rev_product_image" class="cwp_rev_product_image-title"><?php _e( 'Product Image', 'cwp' )?></label>
86
  <input type="text" name="cwp_rev_product_image" id="cwp_rev_product_image" value="<?php if ( isset ( $cwp_review_stored_meta['cwp_rev_product_image'][0] ) ) echo $cwp_review_stored_meta['cwp_rev_product_image'][0]; ?>" />
87
  <input type="button" id="cwp_rev_product_image-button" class="button" value="<?php _e( 'Choose or Upload an Image', 'cwp' )?>" />
88
+
89
 
90
 
91
 
95
 
96
  <li>
97
 
98
+ <label for="cwp_product_affiliate_text"><?php _e("Affiliate Button Text", "cwp"); ?></label>
99
 
100
  <input type="text" name="cwp_product_affiliate_text" id="cwp_product_affiliate_text" value="<?php if(isset($cwp_review_stored_meta['cwp_product_affiliate_text'][0])) { echo $cwp_review_stored_meta['cwp_product_affiliate_text'][0]; } ?>"/>
101
 
105
 
106
  <li>
107
 
108
+ <label for="cwp_product_affiliate_link"><?php _e("Affiliate Link", "cwp"); ?></label>
109
 
110
  <input type="text" name="cwp_product_affiliate_link" id="cwp_product_affiliate_link" value="<?php if(isset($cwp_review_stored_meta['cwp_product_affiliate_link'][0])) { echo $cwp_review_stored_meta['cwp_product_affiliate_link'][0]; } ?>"/>
111
 
122
 
123
 
124
  <div class="review-settings-notice">
125
+
126
+ <h4><?php _e("Product Options Setting", "cwp"); ?></h4>
127
+
128
+ <div class="preloadInfo"><?php _e("Insert your options and their grades. Grading must be done <b><i>from 0 to 100</i></b>. For more information about this, please consult <a href='https://themeisle.com/plugins/wp-product-review-lite/'>this</a>.", "cwp"); ?></div>
129
+
130
+
131
+
132
+ </div><!-- end .review-settings-notice -->
 
 
 
133
 
134
  <div class="review-settings-group">
135
 
199
 
200
  <div class="review-settings-notice">
201
 
202
+ <h4><?php _e("Pro Features", "cwp"); ?></h4>
203
 
204
+ <p style="margin:0;"><?php _e("Insert product's pro features below.", "cwp"); ?></p>
205
 
206
  </div><!-- end .review-settings-notice -->
207
 
273
 
274
  <div class="review-settings-notice">
275
 
276
+ <h4><?php _e("Cons Features", "cwp"); ?></h4>
277
 
278
+ <p style="margin:0;"><?php _e("Insert product's cons features below.", "cwp"); ?></p>
279
 
280
  </div><!-- end .review-settings-notice -->
281
 
489
 
490
 
491
 
492
+ if( isset( $_POST[ 'cwp_rev_product_image' ] ) ) {
493
 
494
  update_post_meta( $post_id, 'cwp_rev_product_image', sanitize_text_field( $_POST[ 'cwp_rev_product_image' ] ) );
495
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  }
497
 
498
 
575
 
576
  }
577
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
  }
579
 
580
 
inc/cwp_top_products_widget.php CHANGED
@@ -1,293 +1,136 @@
1
- <?php
2
-
3
- /**
4
-
5
- * CWP - Top Producs Widget
6
-
7
- */
8
-
9
-
10
-
11
- class cwp_top_products_widget extends WP_Widget {
12
-
13
-
14
-
15
- function __construct() {
16
-
17
- parent::__construct(
18
-
19
- 'cwp_top_products_widget',
20
-
21
- __('WP Product Review Top Products Widget', 'cwppos'),
22
-
23
-
24
-
25
- // Widget description
26
-
27
- array( 'description' => __( 'This widget displays the top products based on their rating.', 'cwppos' ), )
28
-
29
- );
30
-
31
-
32
-
33
- }
34
-
35
-
36
-
37
- // Creating widget front-end
38
-
39
- // This is where the action happens
40
-
41
- public function widget( $args, $instance ) {
42
-
43
- $title = apply_filters( 'widget_title', $instance['title'] );
44
-
45
- $no_items = apply_filters( 'widget_content', $instance['no_items'] );
46
-
47
- $cwp_tp_category = apply_filters( 'widget_content', $instance['cwp_tp_category'] );
48
-
49
-
50
-
51
- // before and after widget arguments are defined by themes
52
-
53
- //echo "<div id='cwp_top_products_widget'>";
54
-
55
- echo $args['before_widget'];
56
-
57
- if ( ! empty( $title ) )
58
-
59
- echo $args['before_title'] . $title . $args['after_title'];
60
-
61
-
62
- if ( $cwp_tp_category=="All") $cwp_tp_category="";
63
- // Loop to get the most popular posts, ordered by the author's final grade.
64
-
65
- $query_args = array(
66
-
67
- 'posts_per_page'=> $no_items, // limit it to the specified no of posts
68
- 'post_type' => "any",
69
- 'category_name' => $cwp_tp_category, // limit it to the specified category
70
- 'meta_key' => 'option_overall_score',
71
-
72
- 'meta_query' => array(
73
-
74
- array(
75
-
76
- 'key' => 'cwp_meta_box_check',
77
-
78
- 'value' => 'Yes',
79
-
80
-
81
- ),
82
-
83
- ),
84
- 'orderby' => 'meta_value_num',
85
- 'order' => 'DESC'
86
-
87
- );
88
-
89
-
90
-
91
- $cwp_top_products_loop = new WP_Query( $query_args );
92
-
93
- echo "<ul>";
94
-
95
- while($cwp_top_products_loop->have_posts()) : $cwp_top_products_loop->the_post(); ?>
96
-
97
-
98
-
99
- <li class="cwp-popular-review cwp_top_posts_widget_<?php the_ID(); ?>">
100
-
101
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
102
-
103
-
104
-
105
-
106
-
107
- <?php
108
- for($i=1; $i<6; $i++) {
109
- ${"option".$i."_grade"} = get_post_meta($cwp_top_products_loop->post->ID, "option_".$i."_grade", true);
110
- //if(empty(${"option".$i."_grade"})) { ${"option".$i."_grade"} = "10"; }
111
- }
112
-
113
- for($i=1; $i<6; $i++) {
114
- ${"option".$i."_content"} = get_post_meta($cwp_top_products_loop->post->ID, "option_".$i."_content", true);
115
- //if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwppos"); }
116
- }
117
- $overall_score = "";
118
- $iter = "";
119
- if(!empty($option1_grade)) { $overall_score += $option1_grade; $iter++; }
120
- if(!empty($option2_grade)) { $overall_score += $option2_grade; $iter++; }
121
- if(!empty($option3_grade)) { $overall_score += $option3_grade; $iter++; }
122
- if(!empty($option4_grade)) { $overall_score += $option4_grade; $iter++; }
123
- if(!empty($option5_grade)) { $overall_score += $option5_grade; $iter++; }
124
- $overall_score = $overall_score / $iter;
125
-
126
-
127
- $review_score = $overall_score;
128
- if(!empty($review_score)) { ?>
129
-
130
- <div class="review-grade-widget">
131
-
132
- <div class="cwp-review-chart">
133
-
134
- <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>"><span></span></div>
135
-
136
- </div><!-- end .chart -->
137
-
138
- </div>
139
-
140
- <?php } ?>
141
-
142
- </li><!-- end .popular-review -->
143
-
144
-
145
-
146
- <?php endwhile; ?>
147
-
148
- <?php wp_reset_postdata(); // reset the query
149
-
150
-
151
-
152
- echo "</ul>";
153
-
154
- echo $args['after_widget'];
155
-
156
- //echo "</div>"; // end #cwp_top_products_widget
157
-
158
- }
159
-
160
-
161
-
162
- // Widget Backend
163
-
164
- public function form( $instance ) {
165
-
166
- if ( isset( $instance[ 'title' ] ) ) {
167
-
168
- $title = $instance[ 'title' ];
169
-
170
- $no_items = $instance[ 'no_items' ];
171
-
172
- $cwp_tp_category = $instance[ 'cwp_tp_category' ];
173
-
174
- }
175
-
176
- else {
177
-
178
- $title = __( 'Top Products', 'cwppos' );
179
-
180
- $no_items = __( '10', 'cwppos');
181
-
182
- $cwp_tp_category = "Select Category";
183
-
184
- }
185
-
186
-
187
-
188
- $cwp_tp_categ_array = get_categories('hide_empty=0');
189
-
190
- foreach ($cwp_tp_categ_array as $categs) {
191
-
192
- $cwp_tp_all_categories[$categs->slug] = $categs->name;
193
-
194
- }
195
-
196
-
197
-
198
- // Widget admin form
199
-
200
- ?>
201
-
202
- <p>
203
-
204
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', "cwppos" ); ?></label>
205
-
206
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
207
-
208
- </p>
209
-
210
-
211
-
212
- <p>
213
-
214
- <label for="<?php echo $this->get_field_id( 'no_items' ); ?>"><?php _e( 'Number of posts to show:', "cwppos" ); ?></label>
215
-
216
- <input id="<?php echo $this->get_field_id( 'no_items' ); ?>" name="<?php echo $this->get_field_name( 'no_items' ); ?>" size="3" type="text" value="<?php echo esc_attr( $no_items ); ?>" />
217
-
218
- </p>
219
-
220
-
221
-
222
- <p>
223
-
224
- <?php $cwp_tp_selected_categ = esc_attr( $cwp_tp_category ); ?>
225
-
226
- <label for="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>"><?php _e( 'Category:', "cwppos" ); ?></label>
227
-
228
- <select id="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_category' ); ?>">
229
- <?php echo "<option>All</option>"; ?>
230
-
231
- <?php foreach ($cwp_tp_all_categories as $categ_slug => $categ_name): ?>
232
-
233
- <?php if($categ_slug == $cwp_tp_selected_categ) {
234
-
235
- echo "<option selected>".$categ_slug."</option>";
236
-
237
- } elseif($categ_slug == "") {
238
-
239
- echo "<option>There are no categs</select>";
240
-
241
- } else {
242
-
243
- echo "<option>".$categ_slug."</option>";
244
-
245
- } ?>
246
-
247
- <?php endforeach; ?>
248
-
249
- </select>
250
-
251
- </p>
252
-
253
-
254
-
255
- <?php }
256
-
257
-
258
-
259
- // Updating widget replacing old instances with new
260
-
261
- public function update( $new_instance, $old_instance ) {
262
-
263
- $instance = array();
264
-
265
- $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
266
-
267
- $instance['no_items'] = ( ! empty( $new_instance['no_items'] ) ) ? strip_tags( $new_instance['no_items'] ) : '';
268
-
269
- $instance['cwp_tp_category'] = ( ! empty( $new_instance['cwp_tp_category'] ) ) ? strip_tags( $new_instance['cwp_tp_category'] ) : '';
270
-
271
-
272
-
273
- return $instance;
274
-
275
- }
276
-
277
-
278
-
279
- } // end Class cwp_top_products_widget
280
-
281
-
282
-
283
-
284
-
285
- // Register and load the widget
286
-
287
- function cwp_load_top_products_widget() {
288
-
289
- register_widget( 'cwp_top_products_widget' );
290
-
291
- }
292
-
293
  add_action( 'widgets_init', 'cwp_load_top_products_widget' );
1
+ <?php
2
+ /**
3
+ * CWP - Top Producs Widget
4
+ */
5
+
6
+ class cwp_top_products_widget extends WP_Widget {
7
+
8
+ function __construct() {
9
+ parent::__construct(
10
+ 'cwp_top_products_widget',
11
+ __('CWP Top Products Widget', 'cwppos'),
12
+
13
+ // Widget description
14
+ array( 'description' => __( 'This widget displays the top products based on their rating.', 'cwppos' ), )
15
+ );
16
+
17
+ }
18
+
19
+ // Creating widget front-end
20
+ // This is where the action happens
21
+ public function widget( $args, $instance ) {
22
+ $title = apply_filters( 'widget_title', $instance['title'] );
23
+ $no_items = apply_filters( 'widget_content', $instance['no_items'] );
24
+ $cwp_tp_category = apply_filters( 'widget_content', $instance['cwp_tp_category'] );
25
+
26
+ // before and after widget arguments are defined by themes
27
+ echo "<div id='cwp_top_products_widget'>";
28
+ echo $args['before_widget'];
29
+ if ( ! empty( $title ) )
30
+ echo $args['before_title'] . $title . $args['after_title'];
31
+
32
+ // Loop to get the most popular posts, ordered by the author's final grade.
33
+ $query_args = array(
34
+ 'posts_per_page'=> $no_items, // limit it to the specified no of posts
35
+ 'post_type' => array('post'),
36
+ 'review_category' => $cwp_tp_category, // limit it to the specified category
37
+ 'meta_query' => array(
38
+ array(
39
+ 'key' => 'cwp_meta_box_check',
40
+ 'value' => 'Yes',
41
+ ),
42
+ ),
43
+ );
44
+
45
+ $cwp_top_products_loop = new WP_Query( $query_args );
46
+ echo "<ul>";
47
+ while($cwp_top_products_loop->have_posts()) : $cwp_top_products_loop->the_post(); ?>
48
+
49
+ <li class="cwp-popular-review cwp_top_posts_widget_<?php the_ID(); ?>">
50
+ <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
51
+
52
+
53
+ <?php $review_score = get_post_meta($cwp_top_products_loop->post->ID, "option_overall_score", true);
54
+ if(!empty($review_score)) { ?>
55
+ <div class="review-grade">
56
+ <div class="chart">
57
+ <div class="percentage" data-percent="<?php echo $review_score; ?>"><span></span></div>
58
+ </div><!-- end .chart -->
59
+ </div>
60
+ <?php } ?>
61
+ </li><!-- end .popular-review -->
62
+
63
+ <?php endwhile; ?>
64
+ <?php wp_reset_postdata(); // reset the query
65
+
66
+ echo "</ul>";
67
+ echo $args['after_widget'];
68
+ echo "</div>"; // end #cwp_top_products_widget
69
+ }
70
+
71
+ // Widget Backend
72
+ public function form( $instance ) {
73
+ if ( isset( $instance[ 'title' ] ) ) {
74
+ $title = $instance[ 'title' ];
75
+ $no_items = $instance[ 'no_items' ];
76
+ $cwp_tp_category = $instance[ 'cwp_tp_category' ];
77
+ }
78
+ else {
79
+ $title = __( 'Top Products', 'cwppos' );
80
+ $no_items = __( '10', 'cwppos');
81
+ $cwp_tp_category = "Select Category";
82
+ }
83
+
84
+ $cwp_tp_categ_array = get_categories('hide_empty=0');
85
+ foreach ($cwp_tp_categ_array as $categs) {
86
+ $cwp_tp_all_categories[$categs->slug] = $categs->name;
87
+ }
88
+
89
+ // Widget admin form
90
+ ?>
91
+ <p>
92
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', "cwppos" ); ?></label>
93
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
94
+ </p>
95
+
96
+ <p>
97
+ <label for="<?php echo $this->get_field_id( 'no_items' ); ?>"><?php _e( 'Number of posts to show:', "cwppos" ); ?></label>
98
+ <input id="<?php echo $this->get_field_id( 'no_items' ); ?>" name="<?php echo $this->get_field_name( 'no_items' ); ?>" size="3" type="text" value="<?php echo esc_attr( $no_items ); ?>" />
99
+ </p>
100
+
101
+ <p>
102
+ <?php $cwp_tp_selected_categ = esc_attr( $cwp_tp_category ); ?>
103
+ <label for="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>"><?php _e( 'Category:', "cwppos" ); ?></label>
104
+ <select id="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_category' ); ?>">
105
+ <?php foreach ($cwp_tp_all_categories as $categ_slug => $categ_name): ?>
106
+ <?php if($categ_slug == $cwp_tp_selected_categ) {
107
+ echo "<option selected>".$categ_slug."</option>";
108
+ } elseif($categ_slug == "") {
109
+ echo "<option>There are no categs</select>";
110
+ } else {
111
+ echo "<option>".$categ_slug."</option>";
112
+ } ?>
113
+ <?php endforeach; ?>
114
+ </select>
115
+ </p>
116
+
117
+ <?php }
118
+
119
+ // Updating widget replacing old instances with new
120
+ public function update( $new_instance, $old_instance ) {
121
+ $instance = array();
122
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
123
+ $instance['no_items'] = ( ! empty( $new_instance['no_items'] ) ) ? strip_tags( $new_instance['no_items'] ) : '';
124
+ $instance['cwp_tp_category'] = ( ! empty( $new_instance['cwp_tp_category'] ) ) ? strip_tags( $new_instance['cwp_tp_category'] ) : '';
125
+
126
+ return $instance;
127
+ }
128
+
129
+ } // end Class cwp_top_products_widget
130
+
131
+
132
+ // Register and load the widget
133
+ function cwp_load_top_products_widget() {
134
+ register_widget( 'cwp_top_products_widget' );
135
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  add_action( 'widgets_init', 'cwp_load_top_products_widget' );
inc/images/ajaxload.gif DELETED
Binary file
inc/review-preloader.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- require_once( '../../../../wp-load.php' );
3
-
4
- $args = array(
5
- 'offset' => 0,
6
- 'post_type' => array('post'),
7
- 'meta_query' => array(
8
- array(
9
- 'key' => 'cwp_meta_box_check',
10
- 'value' => 'Yes',
11
- ),
12
- ),
13
- );
14
-
15
- $cwp_query = new WP_Query($args);
16
- while ($cwp_query->have_posts()) : $cwp_query->the_post();
17
- $post_id = $post->ID;
18
- $preloaded_info = array();
19
- $preloaded_info[$post_id] = array();
20
-
21
- ?>
22
- <li class="cwp_preloaded_item clearfix">
23
- <header>
24
-
25
- <h3 class="cwp_p_title"><?php the_title(); ?></h3>
26
- <button class="preload" title="Preload all details">&curarr;</button>
27
- </header>
28
- <?php
29
-
30
- for ($i=1; $i < 6; $i++) {
31
- $preloaded_info[$post_id]["option".$i] = array(
32
- "content" => get_post_meta($post->ID, "option_" . $i ."_content", true),
33
- "grade" => get_post_meta($post->ID, "option_" . $i ."_grade", true),
34
- "pro" => get_post_meta($post->ID, "cwp_option_". $i ."_pro", true),
35
- "cons" => get_post_meta($post->ID, "cwp_option_". $i ."_cons", true),
36
- );
37
- }
38
- ?>
39
-
40
- <div class="cwp_pitem_info post_<?php echo $post_id; ?>">
41
- <ul class="cwp_pitem_options_content">
42
- <h4><?php _e("Options", "cwppos"); ?></h4>
43
- <?php
44
- for ($i=1; $i < 6; $i++) {
45
- $pinfo_temp = $preloaded_info[$post_id]["option". $i]['content'];
46
- if (!empty($pinfo_temp)) {
47
- echo "<li>" . $pinfo_temp. "</li>";
48
- } else {
49
- echo "<li>-</li>";
50
- }
51
- }
52
- ?>
53
- </ul><!-- end .cwp_pitem_options_content -->
54
-
55
- <ul class="cwp_pitem_options_pros">
56
- <h4><?php _e("Pros", "cwppos"); ?></h4>
57
- <?php
58
- for ($i=1; $i < 6; $i++) {
59
- $pinfo_temp = $preloaded_info[$post_id]["option". $i]['pro'];
60
- if (!empty($pinfo_temp)) {
61
- echo "<li>" . $pinfo_temp. "</li>";
62
- } else {
63
- echo "<li>-</li>";
64
- }
65
- }
66
- ?>
67
- </ul><!-- end .cwp_pitem_options_pros -->
68
-
69
- <ul class="cwp_pitem_options_cons">
70
- <h4><?php _e("Cons", "cwppos"); ?></h4>
71
- <?php
72
- for ($i=1; $i < 6; $i++) {
73
- $pinfo_temp = $preloaded_info[$post_id]["option". $i]['cons'];
74
- if (!empty($pinfo_temp)) {
75
- echo "<li>" . $pinfo_temp. "</li>";
76
- } else {
77
- echo "<li>-</li>";
78
- }
79
- }
80
- ?>
81
- </ul><!-- end .cwp_pitem_options_cons -->
82
- </div><!-- end .cwp_pitem_info -->
83
- </li><!-- end .cwp_preloaded_item -->
84
- <?php endwhile; wp_reset_postdata(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/default.mo DELETED
Binary file
languages/default.po DELETED
@@ -1,228 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Wp Product Review\n"
4
- "POT-Creation-Date: 2014-07-28 20:58+0100\n"
5
- "PO-Revision-Date: 2014-07-28 20:58+0100\n"
6
- "Last-Translator: \n"
7
- "Language-Team: ReadyThemes <info@readythemes.com>\n"
8
- "Language: English\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.5.5\n"
13
- "X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__\n"
14
- "X-Poedit-Basepath: ../\n"
15
- "X-Poedit-SearchPath-0: .\n"
16
- "X-Poedit-SearchPath-1: inc\n"
17
-
18
- #: admin/inc/render.php:224
19
- msgid "Normal"
20
- msgstr ""
21
-
22
- #: admin/inc/render.php:225
23
- msgid "Italic"
24
- msgstr ""
25
-
26
- #: admin/inc/render.php:226
27
- msgid "Bold"
28
- msgstr ""
29
-
30
- #: admin/inc/render.php:227
31
- msgid "Bold Italic"
32
- msgstr ""
33
-
34
- #: admin/inc/render.php:279
35
- msgid "No Repeat"
36
- msgstr ""
37
-
38
- #: admin/inc/render.php:280
39
- msgid "Repeat Horizontally"
40
- msgstr ""
41
-
42
- #: admin/inc/render.php:281
43
- msgid "Repeat Vertically"
44
- msgstr ""
45
-
46
- #: admin/inc/render.php:282
47
- msgid "Repeat All"
48
- msgstr ""
49
-
50
- #: admin/inc/render.php:287
51
- msgid "Top Left"
52
- msgstr ""
53
-
54
- #: admin/inc/render.php:288
55
- msgid "Top Center"
56
- msgstr ""
57
-
58
- #: admin/inc/render.php:289
59
- msgid "Top Right"
60
- msgstr ""
61
-
62
- #: admin/inc/render.php:290
63
- msgid "Middle Left"
64
- msgstr ""
65
-
66
- #: admin/inc/render.php:291
67
- msgid "Middle Center"
68
- msgstr ""
69
-
70
- #: admin/inc/render.php:292
71
- msgid "Middle Right"
72
- msgstr ""
73
-
74
- #: admin/inc/render.php:293
75
- msgid "Bottom Left"
76
- msgstr ""
77
-
78
- #: admin/inc/render.php:294
79
- msgid "Bottom Center"
80
- msgstr ""
81
-
82
- #: admin/inc/render.php:295
83
- msgid "Bottom Right"
84
- msgstr ""
85
-
86
- #: admin/inc/render.php:300
87
- msgid "Scroll Normally"
88
- msgstr ""
89
-
90
- #: admin/inc/render.php:301
91
- msgid "Fixed in Place"
92
- msgstr ""
93
-
94
- #: admin/layout/main_page.php:12
95
- msgid "Buy the PRO version"
96
- msgstr ""
97
-
98
- #: admin/layout/main_page.php:14
99
- msgid "Recommended Review Themes"
100
- msgstr ""
101
-
102
- #: admin/layout/main_page.php:16
103
- msgid "Contact us"
104
- msgstr ""
105
-
106
- #: admin/layout/main_page.php:30 admin/layout/main_page.php:70
107
- msgid "Save All Changes"
108
- msgstr ""
109
-
110
- #: admin/layout/main_page.php:33 admin/layout/main_page.php:73
111
- msgid "Options Reset"
112
- msgstr ""
113
-
114
- #: inc/class-remote-notification-client.php:260
115
- msgid "Dismiss notification"
116
- msgstr ""
117
-
118
- #: inc/class-remote-notification-client.php:262
119
- msgid "Dismiss"
120
- msgstr ""
121
-
122
- #: inc/cwp_frontpage.php:1
123
- msgid "No image added."
124
- msgstr ""
125
-
126
- #: inc/cwp_frontpage.php:1
127
- msgid "Default Feature "
128
- msgstr ""
129
-
130
- #: inc/cwp_metabox.php:59
131
- msgid "Product Details"
132
- msgstr ""
133
-
134
- #: inc/cwp_metabox.php:61
135
- msgid "Specify the general details for the reviewed product."
136
- msgstr ""
137
-
138
- #: inc/cwp_metabox.php:75
139
- msgid "Product Name"
140
- msgstr ""
141
-
142
- #: inc/cwp_metabox.php:85
143
- msgid "Product Image"
144
- msgstr ""
145
-
146
- #: inc/cwp_metabox.php:87
147
- msgid "Choose or Upload an Image"
148
- msgstr ""
149
-
150
- #: inc/cwp_metabox.php:98
151
- msgid "Affiliate Button Text"
152
- msgstr ""
153
-
154
- #: inc/cwp_metabox.php:108
155
- msgid "Affiliate Link"
156
- msgstr ""
157
-
158
- #: inc/cwp_metabox.php:125
159
- msgid "Product Options Setting"
160
- msgstr ""
161
-
162
- #: inc/cwp_metabox.php:126
163
- msgid ""
164
- "Insert your options and their grades. Grading must be done <b><i>from 0 to "
165
- "100</i></b>. In order to be able to automatically preload your settings from "
166
- "another posts, you need to <a href='http://www.readythemes.com/wp-product-"
167
- "review-pro/' target='_blank'>Upgrade to PRO</a>."
168
- msgstr ""
169
-
170
- #: inc/cwp_metabox.php:128 inc/cwp_metabox.php:133
171
- msgid "Preload Info"
172
- msgstr ""
173
-
174
- #: inc/cwp_metabox.php:205
175
- msgid "Pro Features"
176
- msgstr ""
177
-
178
- #: inc/cwp_metabox.php:207
179
- msgid "Insert product's pro features below."
180
- msgstr ""
181
-
182
- #: inc/cwp_metabox.php:279
183
- msgid "Cons Features"
184
- msgstr ""
185
-
186
- #: inc/cwp_metabox.php:281
187
- msgid "Insert product's cons features below."
188
- msgstr ""
189
-
190
- #: inc/cwp_top_products_widget.php:21
191
- msgid "WP Product Review Top Products Widget"
192
- msgstr ""
193
-
194
- #: inc/cwp_top_products_widget.php:27
195
- msgid "This widget displays the top products based on their rating."
196
- msgstr ""
197
-
198
- #: inc/cwp_top_products_widget.php:176
199
- msgid "Top Products"
200
- msgstr ""
201
-
202
- #: inc/cwp_top_products_widget.php:178
203
- msgid "10"
204
- msgstr ""
205
-
206
- #: inc/cwp_top_products_widget.php:202
207
- msgid "Title:"
208
- msgstr ""
209
-
210
- #: inc/cwp_top_products_widget.php:212
211
- msgid "Number of posts to show:"
212
- msgstr ""
213
-
214
- #: inc/cwp_top_products_widget.php:224
215
- msgid "Category:"
216
- msgstr ""
217
-
218
- #: inc/review-preloader.php:42
219
- msgid "Options"
220
- msgstr ""
221
-
222
- #: inc/review-preloader.php:56
223
- msgid "Pros"
224
- msgstr ""
225
-
226
- #: inc/review-preloader.php:70
227
- msgid "Cons"
228
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -21,7 +21,8 @@ For updates follow https://twitter.com/ready_themes.
21
 
22
  **Fortcoming**
23
 
24
- - direct amazon integration
 
25
 
26
  **WP Product Review provides following features**
27
 
@@ -56,7 +57,7 @@ Alternatively you can also follow the following steps to install the WP Product
56
  == Frequently Asked Questions ==
57
 
58
  If you have any questions please get in touch with us at,
59
- http://www.readythemes.com/contact/?r=wporg
60
 
61
  == Screenshots ==
62
 
@@ -66,4 +67,4 @@ http://www.readythemes.com/contact/?r=wporg
66
 
67
  for more you can check out
68
 
69
- http://www.readythemes.com/wp-product-review/?r=wporg
21
 
22
  **Fortcoming**
23
 
24
+ - easily import settings from other posts
25
+ - A pro version
26
 
27
  **WP Product Review provides following features**
28
 
57
  == Frequently Asked Questions ==
58
 
59
  If you have any questions please get in touch with us at,
60
+ https://themeisle.com/contact
61
 
62
  == Screenshots ==
63
 
67
 
68
  for more you can check out
69
 
70
+ https://themeisle.com/plugins/wp-product-review-lite/
wp-product-review.php CHANGED
@@ -1,269 +1,234 @@
1
- <?php
2
-
3
- /*
4
-
5
- Plugin Name: WP Product Review
6
-
7
- Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews with ratings, pros and cons and affiliate links .
8
-
9
- Version: 2.2.7
10
-
11
- Author: ReadyThemes
12
-
13
- Author URI: http://www.readythemes.com/
14
- Plugin URI: http://www.readythemes.com/wp-product-review/
15
-
16
- Requires at least: 3.5
17
-
18
- Tested up to: 3.9
19
-
20
- Stable tag: trunk
21
-
22
- License: GPLv2 or later
23
-
24
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
25
-
26
- Text Domain: cwppos
27
- Domain Path: /languages
28
-
29
- */
30
- if (wp_get_theme() !== "Reviewgine Affiliate PRO") {
31
- include "admin/functions.php";
32
-
33
- include "inc/cwp_metabox.php";
34
-
35
- include "inc/cwp_frontpage.php";
36
-
37
- include "inc/cwp_top_products_widget.php";
38
-
39
- include "inc/cwp_comment.php";
40
-
41
-
42
-
43
- /*
44
-
45
- Loading the stylesheet for admin page.
46
-
47
- */
48
-
49
-
50
-
51
-
52
-
53
- function cwppos_pac_admin_init() {
54
-
55
-
56
-
57
- wp_enqueue_style( 'cwp-pac-admin-stylesheet', plugins_url('css/dashboard_styles.css', __FILE__) );
58
-
59
- wp_enqueue_script( 'cwp-pac-script', plugins_url('javascript/admin-review.js', __FILE__),array("jquery"),"20140101",true );
60
-
61
- }
62
-
63
- function preloader_js(){
64
- $options = cwppos();
65
-
66
- if (!class_exists('CWP_PR_PRO_Core')&&$options['cwppos_show_poweredby']=="yes") {
67
- wp_register_script("cwp-review-preload", plugins_url( 'inc/cwp-review-preload.php', __FILE__ ), false, "1.0", "all");
68
- wp_enqueue_script("cwp-review-preload");
69
-
70
- }
71
-
72
- }
73
-
74
- function cwppos_pac_register() {
75
-
76
-
77
-
78
- //wp_register_script( 'jquery-ui-core' );
79
-
80
- //wp_register_script( 'jquery-ui-slider' );
81
-
82
- wp_register_script( 'pie-chart', plugins_url('javascript/pie-chart.js', __FILE__),array("jquery"),"20140101",true );
83
-
84
- wp_register_script( 'cwp-pac-main-script', plugins_url('javascript/main.js', __FILE__),array("jquery",'pie-chart'),"20140101",true );
85
-
86
- wp_register_style( 'cwp-pac-frontpage-stylesheet', plugins_url('css/frontpage.css', __FILE__) );
87
- wp_register_style( 'cwp-pac-widget-stylesheet', plugins_url('css/cwppos-widget.css', __FILE__) );
88
-
89
- wp_register_style( 'jqueryui', plugins_url('css/jquery-ui.css', __FILE__) );
90
-
91
- wp_register_style( 'cwp-pac-fontawesome-stylesheet', plugins_url('css/font-awesome.min.css', __FILE__) );
92
- }
93
-
94
- function cwppos_pac_print() {
95
-
96
- //global $add_my_script;
97
-
98
- global $post;
99
- //echo get_post_meta($post->ID, "cwp_rev_product_name", true);
100
- if (get_post_meta($post->ID, "cwp_rev_product_name", true)!="" || get_post_meta($post->ID, "cwp_rev_product_image", true)!="") {
101
-
102
- wp_print_styles('cwp-pac-frontpage-stylesheet');
103
- wp_print_styles('cwp-pac-widget-stylesheet');
104
- wp_print_styles('jqueryui');
105
- wp_print_styles('cwp-pac-fontawesome-stylesheet');
106
- //wp_print_styles('cwp-pac-widget-stylesheet');
107
- wp_print_scripts('jquery-ui-core');
108
- wp_print_scripts('jquery-ui-slider');
109
- wp_print_scripts('pie-chart');
110
- wp_print_scripts('cwp-pac-main-script');
111
-
112
- }else {
113
- wp_print_styles('cwp-pac-widget-stylesheet');
114
- wp_print_scripts('pie-chart');
115
- wp_print_scripts('cwp-pac-main-script');
116
- }
117
-
118
-
119
-
120
-
121
- }
122
-
123
- function cwppos_dynamic_stylesheet() {
124
-
125
-
126
-
127
- $options = cwppos();
128
-
129
-
130
- ?>
131
-
132
- <style type="text/css">
133
-
134
- #review-statistics .review-wrap-up .review-top { border-top: <?php echo $options['cwppos_reviewboxbd_width']; ?>px solid <?php echo $options['cwppos_reviewboxbd_color']; ?>; }
135
-
136
- .user-comments-grades .comment-meta-grade-bar,
137
-
138
- #review-statistics .review-wu-bars ul li{
139
-
140
- background: <?php echo $options['cwppos_rating_default']; ?>;
141
-
142
-
143
-
144
- }
145
-
146
- <?php if ($options['cwppos_widget_size']!="") {?>
147
-
148
- #review-statistics{
149
- width:<?php echo $options['cwppos_widget_size']; ?>px!important;
150
- }
151
-
152
- <?php } ?>
153
- #review-statistics .review-wrap-up .review-wu-right ul li,#review-statistics .review-wu-bars h3, .review-wu-bars span,#review-statistics .review-wrap-up .review-top .item-category a{
154
-
155
- color: <?php echo $options['cwppos_font_color']; ?>;
156
-
157
- }
158
-
159
- #review-statistics .review-wrap-up .review-wu-right .pros h2 {
160
-
161
- color: <?php echo $options['cwppos_pros_color']; ?>;
162
-
163
- }
164
-
165
-
166
-
167
- #review-statistics .review-wrap-up .review-wu-right .cons h2{
168
-
169
- color: <?php echo $options['cwppos_cons_color']; ?>;
170
-
171
- }
172
-
173
- .affiliate-button a{
174
-
175
- border: 2px solid <?php echo $options['cwppos_buttonbd_color']; ?>;
176
-
177
- }
178
-
179
- .affiliate-button a:hover{
180
-
181
- border: 2px solid <?php echo $options['cwppos_buttonbh_color']; ?>;
182
-
183
- }
184
-
185
- .affiliate-button a{
186
-
187
- background: <?php echo $options['cwppos_buttonbkd_color']; ?>;
188
-
189
- }
190
-
191
- .affiliate-button a:hover{
192
-
193
- background: <?php echo $options['cwppos_buttonbkh_color']; ?>;
194
-
195
- }
196
-
197
- .affiliate-button a span{
198
-
199
- color: <?php echo $options['cwppos_buttontxtd_color']; ?>;
200
-
201
- }
202
-
203
- .affiliate-button a:hover span{
204
-
205
- color: <?php echo $options['cwppos_buttontxth_color']; ?>;
206
-
207
- }
208
-
209
- <?php if($options['cwppos_show_icon'] == 'yes') { ?>
210
-
211
- .affiliate-button a span {
212
-
213
- background:url("<?php echo plugins_url('', __FILE__); ?>/images/cart-icon.png") no-repeat left center;
214
-
215
- }
216
-
217
- .affiliate-button a:hover span{
218
-
219
- background:url("<?php echo plugins_url('', __FILE__); ?>/images/cart-icon-hover.png") no-repeat left center;
220
-
221
- }
222
-
223
- <?php } ?>
224
-
225
-
226
-
227
- </style>
228
-
229
- <script type="text/javascript">
230
-
231
-
232
-
233
- var c1 = "<?php echo $options['cwppos_rating_weak'] ;?>";
234
-
235
- var c2 = "<?php echo $options['cwppos_rating_notbad'] ;?>";
236
-
237
- var c3 = "<?php echo $options['cwppos_rating_good'] ;?>";
238
-
239
- var c4 = "<?php echo $options['cwppos_rating_very_good'] ;?>";
240
-
241
-
242
-
243
- </script>
244
-
245
- <?php
246
-
247
-
248
-
249
- }
250
-
251
- add_action('init', 'cwppos_pac_register');
252
- add_action('wp_head', 'cwppos_pac_print');
253
-
254
- add_action('wp_head','cwppos_dynamic_stylesheet');
255
- add_action( 'admin_init', 'cwppos_pac_admin_init' );
256
- add_action('admin_enqueue_scripts','preloader_js');
257
- if (!class_exists('TAV_Remote_Notification_Client')) {
258
- require( 'inc/class-remote-notification-client.php' );
259
- }
260
- $notification = new TAV_Remote_Notification_Client( 36, '71a28628279f6d55', 'https://themeisle.com/?post_type=notification' );
261
-
262
-
263
- if (class_exists('CWP_PR_PRO_Core')) {
264
- $cwp_pr_pro = new CWP_PR_PRO_Core();
265
- }
266
-
267
- load_plugin_textdomain('cwppos', false, dirname(plugin_basename(__FILE__)).'/languages/');
268
-
269
- }
1
+ <?php
2
+
3
+ /*
4
+
5
+ Plugin Name: WP Product Review
6
+
7
+ Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews with ratings, pros and cons and affiliate links .
8
+
9
+ Version: 2.2.4
10
+
11
+ Author: CodeInWP
12
+
13
+ Author URI: http://codeinwp.com/
14
+
15
+ Requires at least: 3.5
16
+
17
+ Tested up to: 3.9
18
+
19
+ Stable tag: trunk
20
+
21
+ License: GPLv2 or later
22
+
23
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
24
+
25
+ */
26
+ if (wp_get_theme() !== "Reviewgine Affiliate PRO") {
27
+ include "admin/functions.php";
28
+
29
+ include "inc/cwp_metabox.php";
30
+
31
+ include "inc/cwp_frontpage.php";
32
+
33
+ include "inc/cwp_top_products_widget.php";
34
+
35
+ include "inc/cwp_comment.php";
36
+
37
+
38
+
39
+ /*
40
+
41
+ Loading the stylesheet for admin page.
42
+
43
+ */
44
+
45
+
46
+
47
+
48
+
49
+ function cwppos_pac_admin_init() {
50
+
51
+
52
+ wp_enqueue_style( 'cwp-pac-admin-stylesheet', plugins_url('css/dashboard_styles.css', __FILE__) );
53
+
54
+ wp_enqueue_script( 'cwp-pac-script', plugins_url('javascript/admin-review.js', __FILE__),array("jquery"),"20140101",true );
55
+
56
+ }
57
+
58
+ function cwppos_pac_register() {
59
+
60
+
61
+
62
+ //wp_register_script( 'jquery-ui-core' );
63
+
64
+ //wp_register_script( 'jquery-ui-slider' );
65
+
66
+ wp_register_script( 'pie-chart', plugins_url('javascript/pie-chart.js', __FILE__),array("jquery"),"20140101",true );
67
+
68
+ wp_register_script( 'cwp-pac-main-script', plugins_url('javascript/main.js', __FILE__),array("jquery",'pie-chart'),"20140101",true );
69
+
70
+ wp_register_style( 'cwp-pac-frontpage-stylesheet', plugins_url('css/frontpage.css', __FILE__) );
71
+
72
+ wp_register_style( 'jqueryui', plugins_url('css/jquery-ui.css', __FILE__) );
73
+
74
+ wp_register_style( 'cwp-pac-fontawesome-stylesheet', plugins_url('css/font-awesome.min.css', __FILE__) );
75
+ }
76
+
77
+ function cwppos_pac_print() {
78
+
79
+ //global $add_my_script;
80
+
81
+ global $post;
82
+ //echo get_post_meta($post->ID, "cwp_rev_product_name", true);
83
+ if (get_post_meta($post->ID, "cwp_rev_product_name", true)!="" || get_post_meta($post->ID, "cwp_rev_product_image", true)!="") {
84
+
85
+ wp_print_styles('cwp-pac-frontpage-stylesheet');
86
+ wp_print_styles('jqueryui');
87
+ wp_print_styles('cwp-pac-fontawesome-stylesheet');
88
+
89
+ wp_print_scripts('jquery-ui-core');
90
+ wp_print_scripts('jquery-ui-slider');
91
+ wp_print_scripts('pie-chart');
92
+ wp_print_scripts('cwp-pac-main-script');
93
+
94
+ }
95
+
96
+
97
+
98
+ }
99
+
100
+ function cwppos_dynamic_stylesheet() {
101
+
102
+
103
+
104
+ $options = cwppos();
105
+
106
+ ?>
107
+
108
+ <style type="text/css">
109
+
110
+ .user-comments-grades .comment-meta-grade-bar,
111
+
112
+ #review-statistics .review-wu-bars ul li{
113
+
114
+ background: <?php echo $options['cwppos_rating_default']; ?>;
115
+
116
+
117
+
118
+ }
119
+
120
+ <?php if ($options['cwppos_widget_size']!="") {?>
121
+
122
+ #review-statistics{
123
+ width:<?php echo $options['cwppos_widget_size']; ?>px!important;
124
+ }
125
+
126
+ <?php } ?>
127
+ #review-statistics .review-wrap-up .review-wu-right ul li,#review-statistics .review-wu-bars h3, .review-wu-bars span,#review-statistics .review-wrap-up .review-top .item-category a{
128
+
129
+ color: <?php echo $options['cwppos_font_color']; ?>;
130
+
131
+ }
132
+
133
+ #review-statistics .review-wrap-up .review-wu-right .pros h2 {
134
+
135
+ color: <?php echo $options['cwppos_pros_color']; ?>;
136
+
137
+ }
138
+
139
+
140
+
141
+ #review-statistics .review-wrap-up .review-wu-right .cons h2{
142
+
143
+ color: <?php echo $options['cwppos_cons_color']; ?>;
144
+
145
+ }
146
+
147
+ .affiliate-button a{
148
+
149
+ border: 2px solid <?php echo $options['cwppos_buttonbd_color']; ?>;
150
+
151
+ }
152
+
153
+ .affiliate-button a:hover{
154
+
155
+ border: 2px solid <?php echo $options['cwppos_buttonbh_color']; ?>;
156
+
157
+ }
158
+
159
+ .affiliate-button a{
160
+
161
+ background: <?php echo $options['cwppos_buttonbkd_color']; ?>;
162
+
163
+ }
164
+
165
+ .affiliate-button a:hover{
166
+
167
+ background: <?php echo $options['cwppos_buttonbkh_color']; ?>;
168
+
169
+ }
170
+
171
+ .affiliate-button a span{
172
+
173
+ color: <?php echo $options['cwppos_buttontxtd_color']; ?>;
174
+
175
+ }
176
+
177
+ .affiliate-button a:hover span{
178
+
179
+ color: <?php echo $options['cwppos_buttontxth_color']; ?>;
180
+
181
+ }
182
+
183
+ <?php if($options['cwppos_show_icon'] == 'yes') { ?>
184
+
185
+ .affiliate-button a span {
186
+
187
+ background:url("<?php echo plugins_url('', __FILE__); ?>/images/cart-icon.png") no-repeat left center;
188
+
189
+ }
190
+
191
+ .affiliate-button a:hover span{
192
+
193
+ background:url("<?php echo plugins_url('', __FILE__); ?>/images/cart-icon-hover.png") no-repeat left center;
194
+
195
+ }
196
+
197
+ <?php } ?>
198
+
199
+
200
+
201
+ </style>
202
+
203
+ <script type="text/javascript">
204
+
205
+
206
+
207
+ var c1 = "<?php echo $options['cwppos_rating_weak'] ;?>";
208
+
209
+ var c2 = "<?php echo $options['cwppos_rating_notbad'] ;?>";
210
+
211
+ var c3 = "<?php echo $options['cwppos_rating_good'] ;?>";
212
+
213
+ var c4 = "<?php echo $options['cwppos_rating_very_good'] ;?>";
214
+
215
+
216
+
217
+ </script>
218
+
219
+ <?php
220
+
221
+
222
+
223
+ }
224
+
225
+ add_action('init', 'cwppos_pac_register');
226
+ add_action('wp_head', 'cwppos_pac_print');
227
+
228
+ add_action('wp_head','cwppos_dynamic_stylesheet');
229
+ add_action( 'admin_init', 'cwppos_pac_admin_init' );
230
+ if (!class_exists('TAV_Remote_Notification_Client')) {
231
+ require( 'inc/class-remote-notification-client.php' );
232
+ }
233
+ $notification = new TAV_Remote_Notification_Client( 36, '71a28628279f6d55', 'http://themeisle.com/?post_type=notification' );
234
+ }