Version Description
- Added: Up/Down subtotal voting support. [PRO]
- Added: 3 new templates. (Stackoverflow Votings, Badge Thumb, Star Thumb) [PRO]
- Added: HTML support for button custom text option.
- Added: Search field for the options panel.
- Removed: Old microdata display on front-end posts.
- Fixed: Anonymise IP issue.
- Fixed: An issue with comments auto display hook.
- Fixed: Some reported issues.
Download this release
Release Info
Developer | alimir |
Plugin | WP ULike |
Version | 4.1.4 |
Comparing to | |
See all releases |
Code changes from version 4.1.3 to 4.1.4
- admin/assets/js/plugins.js +1 -1
- admin/classes/class-wp-ulike-admin-panel.php +10 -3
- assets/js/wp-ulike.js +16 -3
- assets/js/wp-ulike.min.js +1 -1
- inc/classes/class-wp-ulike.php +2 -2
- inc/frontend-ajax.php +6 -4
- inc/general-functions.php +41 -3
- inc/general-hooks.php +3 -3
- readme.txt +13 -3
- wp-ulike.php +8 -28
admin/assets/js/plugins.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WP ULike - v4.1.
|
2 |
* https://wpulike.com
|
3 |
* TechnoWich 2020;
|
4 |
*/
|
1 |
+
/*! WP ULike - v4.1.4
|
2 |
* https://wpulike.com
|
3 |
* TechnoWich 2020;
|
4 |
*/
|
admin/classes/class-wp-ulike-admin-panel.php
CHANGED
@@ -44,7 +44,7 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
|
|
44 |
'show_bar_menu' => false,
|
45 |
'show_sub_menu' => false,
|
46 |
'show_network_menu' => false,
|
47 |
-
'show_search' =>
|
48 |
'show_reset_all' => true,
|
49 |
'show_reset_section' => true,
|
50 |
'show_footer' => true,
|
@@ -378,6 +378,7 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
|
|
378 |
'text_group' => array(
|
379 |
'id' => 'text_group',
|
380 |
'type' => 'tabbed',
|
|
|
381 |
'title' => __( 'Button Text', WP_ULIKE_SLUG),
|
382 |
'tabs' => array(
|
383 |
array(
|
@@ -385,7 +386,10 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
|
|
385 |
'fields' => array(
|
386 |
array(
|
387 |
'id' => 'like',
|
388 |
-
'type' => '
|
|
|
|
|
|
|
389 |
'title' => __('Button Text',WP_ULIKE_SLUG),
|
390 |
'default' => 'Like'
|
391 |
),
|
@@ -396,7 +400,10 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
|
|
396 |
'fields' => array(
|
397 |
array(
|
398 |
'id' => 'unlike',
|
399 |
-
'type' => '
|
|
|
|
|
|
|
400 |
'title' => __('Button Text',WP_ULIKE_SLUG),
|
401 |
'default' => 'Liked'
|
402 |
),
|
44 |
'show_bar_menu' => false,
|
45 |
'show_sub_menu' => false,
|
46 |
'show_network_menu' => false,
|
47 |
+
'show_search' => true,
|
48 |
'show_reset_all' => true,
|
49 |
'show_reset_section' => true,
|
50 |
'show_footer' => true,
|
378 |
'text_group' => array(
|
379 |
'id' => 'text_group',
|
380 |
'type' => 'tabbed',
|
381 |
+
'desc' => __( 'Enter your custom button text in the fields above. You can also use HTML tags in these fields.', WP_ULIKE_SLUG),
|
382 |
'title' => __( 'Button Text', WP_ULIKE_SLUG),
|
383 |
'tabs' => array(
|
384 |
array(
|
386 |
'fields' => array(
|
387 |
array(
|
388 |
'id' => 'like',
|
389 |
+
'type' => 'code_editor',
|
390 |
+
'settings' => array(
|
391 |
+
'mode' => 'htmlmixed',
|
392 |
+
),
|
393 |
'title' => __('Button Text',WP_ULIKE_SLUG),
|
394 |
'default' => 'Like'
|
395 |
),
|
400 |
'fields' => array(
|
401 |
array(
|
402 |
'id' => 'unlike',
|
403 |
+
'type' => 'code_editor',
|
404 |
+
'settings' => array(
|
405 |
+
'mode' => 'htmlmixed',
|
406 |
+
),
|
407 |
'title' => __('Button Text',WP_ULIKE_SLUG),
|
408 |
'default' => 'Liked'
|
409 |
),
|
assets/js/wp-ulike.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! WP ULike - v4.1.
|
2 |
* https://wpulike.com
|
3 |
* TechnoWich 2020;
|
4 |
*/
|
@@ -139,6 +139,7 @@
|
|
139 |
displayLikers: false,
|
140 |
disablePophover: true,
|
141 |
factor: '',
|
|
|
142 |
counterSelector: ".count-box",
|
143 |
generalSelector: ".wp_ulike_general_class",
|
144 |
buttonSelector: ".wp_ulike_btn",
|
@@ -152,7 +153,8 @@
|
|
152 |
"ulike-display-likers": "displayLikers",
|
153 |
"ulike-disable-pophover": "disablePophover",
|
154 |
"ulike-append-timeout": "appendTimeout",
|
155 |
-
"ulike-factor": "factor"
|
|
|
156 |
};
|
157 |
|
158 |
// The actual plugin constructor
|
@@ -228,7 +230,8 @@
|
|
228 |
id: this.settings.ID,
|
229 |
nonce: this.settings.nonce,
|
230 |
factor: this.settings.factor,
|
231 |
-
type: this.settings.type
|
|
|
232 |
},
|
233 |
function (response) {
|
234 |
//remove progress class
|
@@ -279,6 +282,9 @@
|
|
279 |
_updateMarkup: function (response) {
|
280 |
// Set sibling general elements
|
281 |
this._setSbilingElement();
|
|
|
|
|
|
|
282 |
this._updateGeneralClassNames(response.data.status);
|
283 |
// If data exist
|
284 |
if( response.data.data !== null ){
|
@@ -360,6 +366,10 @@
|
|
360 |
this.siblingElement = this.generalElement.siblings();
|
361 |
},
|
362 |
|
|
|
|
|
|
|
|
|
363 |
__updateCounter: function (counterValue) {
|
364 |
if (typeof counterValue !== "object") {
|
365 |
this.counterElement.text(counterValue);
|
@@ -464,6 +474,9 @@
|
|
464 |
if (this.siblingElement.length) {
|
465 |
this.siblingElement.find(this.settings.buttonSelector).removeClass("image-unlike wp_ulike_btn_is_active");
|
466 |
}
|
|
|
|
|
|
|
467 |
} else if (this.buttonElement.hasClass("wp_ulike_put_text") && btnText !== null) {
|
468 |
if (typeof btnText !== "object") {
|
469 |
this.buttonElement.find("span").html(btnText);
|
1 |
+
/*! WP ULike - v4.1.4
|
2 |
* https://wpulike.com
|
3 |
* TechnoWich 2020;
|
4 |
*/
|
139 |
displayLikers: false,
|
140 |
disablePophover: true,
|
141 |
factor: '',
|
142 |
+
template: '',
|
143 |
counterSelector: ".count-box",
|
144 |
generalSelector: ".wp_ulike_general_class",
|
145 |
buttonSelector: ".wp_ulike_btn",
|
153 |
"ulike-display-likers": "displayLikers",
|
154 |
"ulike-disable-pophover": "disablePophover",
|
155 |
"ulike-append-timeout": "appendTimeout",
|
156 |
+
"ulike-factor": "factor",
|
157 |
+
"ulike-template": "template",
|
158 |
};
|
159 |
|
160 |
// The actual plugin constructor
|
230 |
id: this.settings.ID,
|
231 |
nonce: this.settings.nonce,
|
232 |
factor: this.settings.factor,
|
233 |
+
type: this.settings.type,
|
234 |
+
template: this.settings.template
|
235 |
},
|
236 |
function (response) {
|
237 |
//remove progress class
|
282 |
_updateMarkup: function (response) {
|
283 |
// Set sibling general elements
|
284 |
this._setSbilingElement();
|
285 |
+
// Set sibling button elements
|
286 |
+
this._setSbilingButtons();
|
287 |
+
// Update general element class names
|
288 |
this._updateGeneralClassNames(response.data.status);
|
289 |
// If data exist
|
290 |
if( response.data.data !== null ){
|
366 |
this.siblingElement = this.generalElement.siblings();
|
367 |
},
|
368 |
|
369 |
+
_setSbilingButtons: function () {
|
370 |
+
this.siblingButton = this.buttonElement.siblings( this.settings.buttonSelector );
|
371 |
+
},
|
372 |
+
|
373 |
__updateCounter: function (counterValue) {
|
374 |
if (typeof counterValue !== "object") {
|
375 |
this.counterElement.text(counterValue);
|
474 |
if (this.siblingElement.length) {
|
475 |
this.siblingElement.find(this.settings.buttonSelector).removeClass("image-unlike wp_ulike_btn_is_active");
|
476 |
}
|
477 |
+
if( this.siblingButton.length ) {
|
478 |
+
this.siblingButton.removeClass("image-unlike wp_ulike_btn_is_active");
|
479 |
+
}
|
480 |
} else if (this.buttonElement.hasClass("wp_ulike_put_text") && btnText !== null) {
|
481 |
if (typeof btnText !== "object") {
|
482 |
this.buttonElement.find("span").html(btnText);
|
assets/js/wp-ulike.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(i){"use strict";var s="WordpressUlikeNotifications",n={messageType:"success",messageText:"Hello World!",messageElement:"wpulike-message",notifContainer:"wpulike-notification"};function t
|
1 |
+
!function(i){"use strict";var s="WordpressUlikeNotifications",n={messageType:"success",messageText:"Hello World!",messageElement:"wpulike-message",notifContainer:"wpulike-notification"};function e(t,e){this.element=t,this.$element=i(t),this.settings=i.extend({},n,e),this._defaults=n,this._name=s,this.init()}i.extend(e.prototype,{init:function(){this._message(),this._container(),this._append(),this._remove()},_message:function(){this.$messageElement=i("<div/>").addClass(this.settings.messageElement+" wpulike-"+this.settings.messageType).text(this.settings.messageText)},_container:function(){i("."+this.settings.notifContainer).length||this.$element.append(i("<div/>").addClass(this.settings.notifContainer)),this.$notifContainer=this.$element.find("."+this.settings.notifContainer)},_append:function(){this.$notifContainer.append(this.$messageElement).trigger("WordpressUlikeNotificationAppend")},_remove:function(){var t=this;this.$messageElement.click(function(){i(this).fadeOut(300,function(){i(this).remove(),i("."+t.settings.messageElement).length||t.$notifContainer.remove()}).trigger("WordpressUlikeRemoveNotification")}),setTimeout(function(){t.$messageElement.fadeOut(300,function(){i(this).remove(),i("."+t.settings.messageElement).length||t.$notifContainer.remove()}).trigger("WordpressUlikeRemoveNotification")},8e3)}}),i.fn[s]=function(t){return this.each(function(){new e(this,t)})}}(jQuery,window,document),function(n,t,i){"use strict";var l="WordpressUlike",e=(n(t),n(i)),a={ID:0,nonce:0,type:"",append:"",appendTimeout:2e3,displayLikers:!1,disablePophover:!0,factor:"",template:"",counterSelector:".count-box",generalSelector:".wp_ulike_general_class",buttonSelector:".wp_ulike_btn",likersSelector:".wp_ulike_likers_wrapper"},o={"ulike-id":"ID","ulike-nonce":"nonce","ulike-type":"type","ulike-append":"append","ulike-display-likers":"displayLikers","ulike-disable-pophover":"disablePophover","ulike-append-timeout":"appendTimeout","ulike-factor":"factor","ulike-template":"template"};function s(t,e){for(var i in this.element=t,this.$element=n(t),this.settings=n.extend({},a,e),this._defaults=a,this._name=l,this._refreshTheLikers=!1,this.buttonElement=this.$element.find(this.settings.buttonSelector),this.generalElement=this.$element.find(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector),o){var s=this.buttonElement.data(i);void 0!==s&&(this.settings[o[i]]=s)}this.init()}n.extend(s.prototype,{init:function(){this.buttonElement.click(this._initLike.bind(this)),this.buttonElement.one("mouseenter",this._updateLikers.bind(this))},_ajax:function(t,e){n.ajax({url:wp_ulike_params.ajax_url,type:"POST",cache:!1,dataType:"json",data:t}).done(e)},_initLike:function(t){t.stopPropagation(),this._maybeUpdateElements(t),this._updateSameButtons(),this.buttonElement.prop("disabled",!0),e.trigger("WordpressUlikeLoading",this.element),this.generalElement.addClass("wp_ulike_is_loading"),this._ajax({action:"wp_ulike_process",id:this.settings.ID,nonce:this.settings.nonce,factor:this.settings.factor,type:this.settings.type,template:this.settings.template},function(t){this.generalElement.removeClass("wp_ulike_is_loading"),t.success?(this._updateMarkup(t),this._appendChild()):this._sendNotification("error",t.data),this.buttonElement.prop("disabled",!1),e.trigger("WordpressUlikeUpdated",this.element)}.bind(this))},_maybeUpdateElements:function(t){this.buttonElement=n(t.currentTarget),this.generalElement=this.buttonElement.closest(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector),this.settings.factor=this.buttonElement.data("ulike-factor")},_appendChild:function(){if(""!==this.settings.append){var t=n(this.settings.append);this.buttonElement.append(t),this.settings.appendTimeout&&setTimeout(function(){t.detach()},this.settings.appendTimeout)}},_updateMarkup:function(t){this._setSbilingElement(),this._setSbilingButtons(),this._updateGeneralClassNames(t.data.status),null!==t.data.data&&(t.data.status<5&&(this.__updateCounter(t.data.data),this._refreshTheLikers=!0),this._updateButton(t.data.btnText,t.data.status)),this._sendNotification(t.data.messageType,t.data.message),this._refreshTheLikers&&this._updateLikers()},_updateGeneralClassNames:function(t){var e="wp_ulike_is_not_liked",i="wp_ulike_is_liked",s="wp_ulike_is_unliked",n="wp_ulike_click_is_disabled";switch(this.siblingElement.length&&this.siblingElement.removeClass(this._arrayToString([i,s])),t){case 1:this.generalElement.addClass(i).removeClass(e),this.generalElement.children().first().addClass(n);break;case 2:this.generalElement.addClass(s).removeClass(i);break;case 3:this.generalElement.addClass(i).removeClass(s);break;default:this.generalElement.children().first().addClass(n),this.siblingElement.length&&this.siblingElement.children().first().addClass(n)}},_arrayToString:function(t){return t.join(" ")},_setSbilingElement:function(){this.siblingElement=this.generalElement.siblings()},_setSbilingButtons:function(){this.siblingButton=this.buttonElement.siblings(this.settings.buttonSelector)},__updateCounter:function(t){"object"!=typeof t?this.counterElement.text(t):"down"===this.settings.factor?(this.counterElement.text(t.down),this.siblingElement.length&&this.siblingElement.find(this.settings.counterSelector).text(t.up)):(this.counterElement.text(t.up),this.siblingElement.length&&this.siblingElement.find(this.settings.counterSelector).text(t.down)),e.trigger("WordpressUlikeCounterUpdated",[this.buttonElement])},_updateLikers:function(){this.likersElement=this._getLikersElement(),!this.settings.displayLikers||this.likersElement.length&&!this._refreshTheLikers||(this.generalElement.addClass("wp_ulike_is_getting_likers_list"),this._ajax({action:"wp_ulike_get_likers",id:this.settings.ID,nonce:this.settings.nonce,type:this.settings.type,disablePophover:this.settings.disablePophover,refresh:this._refreshTheLikers?1:0},function(t){this.generalElement.removeClass("wp_ulike_is_getting_likers_list"),t.success&&(this.likersElement.length||(this.likersElement=n("<div>",{class:t.data.class}).appendTo(this.$element)),t.data.template?this.likersElement.show().html(t.data.template):this.likersElement.hide()),this._refreshTheLikers=!1}.bind(this)))},_updateSameButtons:function(){var t=void 0!==this.settings.factor?this.settings.factor:"";this.sameButtons=e.find(".wp_"+this.settings.type.toLowerCase()+t+"_"+this.settings.ID),1<this.sameButtons.length&&(this.buttonElement=this.sameButtons,this.generalElement=this.buttonElement.closest(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector))},_getLikersElement:function(){return this.$element.find(this.settings.likersSelector)},_updateButton:function(t,e){this.buttonElement.hasClass("wp_ulike_put_image")?(this.buttonElement.toggleClass("image-unlike wp_ulike_btn_is_active"),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).removeClass("image-unlike wp_ulike_btn_is_active"),this.siblingButton.length&&this.siblingButton.removeClass("image-unlike wp_ulike_btn_is_active")):this.buttonElement.hasClass("wp_ulike_put_text")&&null!==t&&("object"!=typeof t?this.buttonElement.find("span").html(t):"down"===this.settings.factor?(this.buttonElement.find("span").html(t.down),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).find("span").html(t.up)):(this.buttonElement.find("span").html(t.up),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).find("span").html(t.down)))},_sendNotification:function(t,e){"1"===wp_ulike_params.notifications&&n(i.body).WordpressUlikeNotifications({messageType:t,messageText:e})}}),n.fn[l]=function(t){return this.each(function(){n.data(this,"plugin_"+l)||n.data(this,"plugin_"+l,new s(this,t))})}}(jQuery,window,document),function(e){e(function(){e(this).bind("DOMNodeInserted",function(t){e(".wpulike").WordpressUlike()})}),e(".wpulike").WordpressUlike()}(jQuery);
|
inc/classes/class-wp-ulike.php
CHANGED
@@ -368,12 +368,12 @@ if ( ! class_exists( 'wp_ulike' ) ) {
|
|
368 |
|
369 |
if( $args['button_type'] == 'image' || ( isset( $temp_list[$args['style']]['is_text_support'] ) && ! $temp_list[$args['style']]['is_text_support'] ) ){
|
370 |
$button_class_name .= ' wp_ulike_put_image';
|
371 |
-
|
372 |
$button_class_name .= ' image-unlike wp_ulike_btn_is_active';
|
373 |
}
|
374 |
} else {
|
375 |
$button_class_name .= ' wp_ulike_put_text';
|
376 |
-
|
377 |
$button_text = wp_ulike_get_button_text( 'unlike', $args['setting'] );
|
378 |
} else {
|
379 |
$button_text = wp_ulike_get_button_text( 'like', $args['setting'] );
|
368 |
|
369 |
if( $args['button_type'] == 'image' || ( isset( $temp_list[$args['style']]['is_text_support'] ) && ! $temp_list[$args['style']]['is_text_support'] ) ){
|
370 |
$button_class_name .= ' wp_ulike_put_image';
|
371 |
+
if( in_array( $status, array( 2, 4 ) ) ){
|
372 |
$button_class_name .= ' image-unlike wp_ulike_btn_is_active';
|
373 |
}
|
374 |
} else {
|
375 |
$button_class_name .= ' wp_ulike_put_text';
|
376 |
+
if( in_array( $status, array( 2, 4 ) ) && strpos( $user_status, 'dis') !== 0){
|
377 |
$button_text = wp_ulike_get_button_text( 'unlike', $args['setting'] );
|
378 |
} else {
|
379 |
$button_text = wp_ulike_get_button_text( 'like', $args['setting'] );
|
inc/frontend-ajax.php
CHANGED
@@ -22,10 +22,11 @@ function wp_ulike_process(){
|
|
22 |
// Global variables
|
23 |
global $wp_ulike_class;
|
24 |
|
25 |
-
$post_ID = isset( $_POST['id'] ) ? $_POST['id'] : NULL;
|
26 |
-
$post_type = isset( $_POST['type'] ) ? $_POST['type'] : NULL;
|
27 |
-
$nonce_token = isset( $_POST['nonce'] ) ? $_POST['nonce'] : NULL;
|
28 |
-
$factor = isset( $_POST['factor'] ) ? $_POST['factor'] : NULL;
|
|
|
29 |
$response = array();
|
30 |
$status = 0;
|
31 |
|
@@ -57,6 +58,7 @@ function wp_ulike_process(){
|
|
57 |
"slug" => $slug,
|
58 |
"cookie" => $cookie,
|
59 |
"factor" => $factor,
|
|
|
60 |
"logging_method" => isset( $options['logging_method'] ) ? $options['logging_method'] : 'by_username',
|
61 |
"only_logged_in_users" => isset( $options['enable_only_logged_in_users'] ) ? $options['enable_only_logged_in_users'] : 0,
|
62 |
"logged_out_action" => isset( $options['logged_out_display_type'] ) ? $options['logged_out_display_type'] : 'button'
|
22 |
// Global variables
|
23 |
global $wp_ulike_class;
|
24 |
|
25 |
+
$post_ID = isset( $_POST['id'] ) ? esc_html( $_POST['id'] ) : NULL;
|
26 |
+
$post_type = isset( $_POST['type'] ) ? esc_html( $_POST['type'] ) : NULL;
|
27 |
+
$nonce_token = isset( $_POST['nonce'] ) ? esc_html( $_POST['nonce'] ) : NULL;
|
28 |
+
$factor = isset( $_POST['factor'] ) ? esc_html( $_POST['factor'] ) : NULL;
|
29 |
+
$template = isset( $_POST['template'] ) ? esc_html( $_POST['template'] ) : 'wpulike-default';
|
30 |
$response = array();
|
31 |
$status = 0;
|
32 |
|
58 |
"slug" => $slug,
|
59 |
"cookie" => $cookie,
|
60 |
"factor" => $factor,
|
61 |
+
"style" => $template,
|
62 |
"logging_method" => isset( $options['logging_method'] ) ? $options['logging_method'] : 'by_username',
|
63 |
"only_logged_in_users" => isset( $options['enable_only_logged_in_users'] ) ? $options['enable_only_logged_in_users'] : 0,
|
64 |
"logged_out_action" => isset( $options['logged_out_display_type'] ) ? $options['logged_out_display_type'] : 'button'
|
inc/general-functions.php
CHANGED
@@ -1380,6 +1380,38 @@ if( ! function_exists( 'wp_ulike_date_i18n' ) ){
|
|
1380 |
}
|
1381 |
}
|
1382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1383 |
if( ! function_exists( 'wp_ulike_generate_user_id' ) ){
|
1384 |
/**
|
1385 |
* Convert IP to a integer value
|
@@ -1394,7 +1426,9 @@ if( ! function_exists( 'wp_ulike_generate_user_id' ) ){
|
|
1394 |
if( filter_var( $user_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
|
1395 |
return ip2long( $user_ip );
|
1396 |
} else {
|
1397 |
-
|
|
|
|
|
1398 |
foreach ( unpack( 'C*', inet_pton( $user_ip ) ) as $byte ) {
|
1399 |
$binary_val .= decbin( $byte );
|
1400 |
}
|
@@ -1682,6 +1716,7 @@ if( ! function_exists( 'wp_ulike_set_default_template' ) ){
|
|
1682 |
data-ulike-id="<?php echo $ID; ?>"
|
1683 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1684 |
data-ulike-type="<?php echo $type; ?>"
|
|
|
1685 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1686 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1687 |
class="<?php echo $button_class; ?>">
|
@@ -1725,6 +1760,7 @@ if( ! function_exists( 'wp_ulike_set_simple_heart_template' ) ){
|
|
1725 |
data-ulike-id="<?php echo $ID; ?>"
|
1726 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1727 |
data-ulike-type="<?php echo $type; ?>"
|
|
|
1728 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1729 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1730 |
class="<?php echo $button_class; ?>">
|
@@ -1764,15 +1800,16 @@ if( ! function_exists( 'wp_ulike_set_robeen_template' ) ){
|
|
1764 |
?>
|
1765 |
<div class="wpulike wpulike-robeen <?php echo $wrapper_class; ?>" <?php echo $attributes; ?>>
|
1766 |
<div class="<?php echo $general_class; ?>">
|
1767 |
-
<label title="<?php
|
1768 |
<input type="checkbox"
|
1769 |
data-ulike-id="<?php echo $ID; ?>"
|
1770 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1771 |
data-ulike-type="<?php echo $type; ?>"
|
|
|
1772 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1773 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1774 |
class="<?php echo $button_class; ?>"
|
1775 |
-
<?php echo
|
1776 |
<?php do_action( 'wp_ulike_inside_like_button', $wp_ulike_template ); ?>
|
1777 |
<svg class="heart-svg" viewBox="467 392 58 57" xmlns="http://www.w3.org/2000/svg">
|
1778 |
<g class="Group" fill="none" fill-rule="evenodd" transform="translate(467 392)">
|
@@ -1843,6 +1880,7 @@ if( ! function_exists( 'wp_ulike_set_animated_heart_template' ) ){
|
|
1843 |
data-ulike-id="<?php echo $ID; ?>"
|
1844 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1845 |
data-ulike-type="<?php echo $type; ?>"
|
|
|
1846 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1847 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1848 |
data-ulike-append="<?php echo htmlspecialchars( '<svg class="wpulike-svg-heart wpulike-svg-heart-pop one" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop two" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop three" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop four" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop five" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop six" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop seven" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop eight" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop nine" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg>' ); ?>"
|
1380 |
}
|
1381 |
}
|
1382 |
|
1383 |
+
if( ! function_exists( 'wp_ulike_get_user_ip' ) ){
|
1384 |
+
/**
|
1385 |
+
* Get user IP
|
1386 |
+
*
|
1387 |
+
* @return string
|
1388 |
+
*/
|
1389 |
+
function wp_ulike_get_user_ip(){
|
1390 |
+
$ip = '';
|
1391 |
+
|
1392 |
+
if ( getenv( 'HTTP_CLIENT_IP' ) ) {
|
1393 |
+
$ip = getenv( 'HTTP_CLIENT_IP' );
|
1394 |
+
} elseif ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
|
1395 |
+
$ip = getenv( 'HTTP_X_FORWARDED_FOR' );
|
1396 |
+
} elseif ( getenv( 'HTTP_X_FORWARDED' ) ) {
|
1397 |
+
$ip = getenv( 'HTTP_X_FORWARDED' );
|
1398 |
+
} elseif ( getenv( 'HTTP_FORWARDED_FOR' ) ) {
|
1399 |
+
$ip = getenv( 'HTTP_FORWARDED_FOR' );
|
1400 |
+
} elseif ( getenv( 'HTTP_FORWARDED' ) ) {
|
1401 |
+
$ip = getenv( 'HTTP_FORWARDED' );
|
1402 |
+
} else {
|
1403 |
+
$ip = $_SERVER['REMOTE_ADDR'];
|
1404 |
+
}
|
1405 |
+
|
1406 |
+
if ( ! filter_var( $ip, FILTER_VALIDATE_IP ) ) {
|
1407 |
+
// Return local ip address
|
1408 |
+
return '127.0.0.1';
|
1409 |
+
}
|
1410 |
+
|
1411 |
+
return $ip;
|
1412 |
+
}
|
1413 |
+
}
|
1414 |
+
|
1415 |
if( ! function_exists( 'wp_ulike_generate_user_id' ) ){
|
1416 |
/**
|
1417 |
* Convert IP to a integer value
|
1426 |
if( filter_var( $user_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
|
1427 |
return ip2long( $user_ip );
|
1428 |
} else {
|
1429 |
+
// Get non-anonymise IP address
|
1430 |
+
$user_ip = wp_ulike_get_user_ip();
|
1431 |
+
$binary_val = '';
|
1432 |
foreach ( unpack( 'C*', inet_pton( $user_ip ) ) as $byte ) {
|
1433 |
$binary_val .= decbin( $byte );
|
1434 |
}
|
1716 |
data-ulike-id="<?php echo $ID; ?>"
|
1717 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1718 |
data-ulike-type="<?php echo $type; ?>"
|
1719 |
+
data-ulike-template="<?php echo $style; ?>"
|
1720 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1721 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1722 |
class="<?php echo $button_class; ?>">
|
1760 |
data-ulike-id="<?php echo $ID; ?>"
|
1761 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1762 |
data-ulike-type="<?php echo $type; ?>"
|
1763 |
+
data-ulike-template="<?php echo $style; ?>"
|
1764 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1765 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1766 |
class="<?php echo $button_class; ?>">
|
1800 |
?>
|
1801 |
<div class="wpulike wpulike-robeen <?php echo $wrapper_class; ?>" <?php echo $attributes; ?>>
|
1802 |
<div class="<?php echo $general_class; ?>">
|
1803 |
+
<label title="<?php _e( 'Like This', WP_ULIKE_SLUG ); ?>">
|
1804 |
<input type="checkbox"
|
1805 |
data-ulike-id="<?php echo $ID; ?>"
|
1806 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1807 |
data-ulike-type="<?php echo $type; ?>"
|
1808 |
+
data-ulike-template="<?php echo $style; ?>"
|
1809 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1810 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1811 |
class="<?php echo $button_class; ?>"
|
1812 |
+
<?php echo in_array( $status, array( 2, 4 ) ) ? 'checked="checked"' : ''; ?> />
|
1813 |
<?php do_action( 'wp_ulike_inside_like_button', $wp_ulike_template ); ?>
|
1814 |
<svg class="heart-svg" viewBox="467 392 58 57" xmlns="http://www.w3.org/2000/svg">
|
1815 |
<g class="Group" fill="none" fill-rule="evenodd" transform="translate(467 392)">
|
1880 |
data-ulike-id="<?php echo $ID; ?>"
|
1881 |
data-ulike-nonce="<?php echo wp_create_nonce( $type . $ID ); ?>"
|
1882 |
data-ulike-type="<?php echo $type; ?>"
|
1883 |
+
data-ulike-template="<?php echo $style; ?>"
|
1884 |
data-ulike-display-likers="<?php echo $display_likers; ?>"
|
1885 |
data-ulike-disable-pophover="<?php echo $disable_pophover; ?>"
|
1886 |
data-ulike-append="<?php echo htmlspecialchars( '<svg class="wpulike-svg-heart wpulike-svg-heart-pop one" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop two" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop three" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop four" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop five" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop six" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop seven" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop eight" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg><svg class="wpulike-svg-heart wpulike-svg-heart-pop nine" viewBox="0 0 32 29.6"><path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/></svg>' ); ?>"
|
inc/general-hooks.php
CHANGED
@@ -224,7 +224,7 @@ if( ! function_exists( 'wp_ulike_get_posts_microdata_itemtype' ) ){
|
|
224 |
if(!is_singular() || !wp_ulike_get_setting( 'wp_ulike_posts', 'google_rich_snippets') || $get_ulike_count == 0) return;
|
225 |
return 'itemscope itemtype="http://schema.org/CreativeWork"';
|
226 |
}
|
227 |
-
add_filter('wp_ulike_posts_add_attr', 'wp_ulike_get_posts_microdata_itemtype');
|
228 |
}
|
229 |
|
230 |
if( ! function_exists( 'wp_ulike_get_posts_microdata' ) ){
|
@@ -257,7 +257,7 @@ if( ! function_exists( 'wp_ulike_get_posts_microdata' ) ){
|
|
257 |
$itemtype = apply_filters( 'wp_ulike_remove_microdata_post_meta', false );
|
258 |
return apply_filters( 'wp_ulike_generate_google_structured_data', ( $itemtype ? $ratings_meta : ( $post_meta . $ratings_meta ) ) );
|
259 |
}
|
260 |
-
add_filter( 'wp_ulike_posts_microdata', 'wp_ulike_get_posts_microdata');
|
261 |
}
|
262 |
|
263 |
/*******************************************************
|
@@ -298,7 +298,7 @@ if( ! function_exists( 'wp_ulike_put_comments' ) ){
|
|
298 |
|
299 |
return apply_filters( 'wp_ulike_comment_text', $output, $content );
|
300 |
}
|
301 |
-
add_filter( '
|
302 |
}
|
303 |
|
304 |
|
224 |
if(!is_singular() || !wp_ulike_get_setting( 'wp_ulike_posts', 'google_rich_snippets') || $get_ulike_count == 0) return;
|
225 |
return 'itemscope itemtype="http://schema.org/CreativeWork"';
|
226 |
}
|
227 |
+
// add_filter('wp_ulike_posts_add_attr', 'wp_ulike_get_posts_microdata_itemtype');
|
228 |
}
|
229 |
|
230 |
if( ! function_exists( 'wp_ulike_get_posts_microdata' ) ){
|
257 |
$itemtype = apply_filters( 'wp_ulike_remove_microdata_post_meta', false );
|
258 |
return apply_filters( 'wp_ulike_generate_google_structured_data', ( $itemtype ? $ratings_meta : ( $post_meta . $ratings_meta ) ) );
|
259 |
}
|
260 |
+
// add_filter( 'wp_ulike_posts_microdata', 'wp_ulike_get_posts_microdata');
|
261 |
}
|
262 |
|
263 |
/*******************************************************
|
298 |
|
299 |
return apply_filters( 'wp_ulike_comment_text', $output, $content );
|
300 |
}
|
301 |
+
add_filter( 'comment_text', 'wp_ulike_put_comments' );
|
302 |
}
|
303 |
|
304 |
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: wp ulike, like button, elementor, like, dislike, wordpress youlike plugin,
|
|
6 |
Requires PHP: 5.4
|
7 |
Requires at least: 3.5.0
|
8 |
Tested up to: 5.3.2
|
9 |
-
Stable tag: 4.1.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -186,12 +186,22 @@ define( 'WP_MEMORY_LIMIT', '256M' );
|
|
186 |
|
187 |
== Changelog ==
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
= 4.1.3 =
|
190 |
* Fixed: Problems with restoring old settings.
|
191 |
-
* Fixed: An issue in bbPress option panel.
|
192 |
* Fixed: A simple issue with custom icons display.
|
193 |
* Fixed: Some default option values.
|
194 |
-
* Fixed: Button display issue
|
195 |
|
196 |
= 4.1.2 =
|
197 |
* Fixed: WPcolor js issue in the setting panel.
|
6 |
Requires PHP: 5.4
|
7 |
Requires at least: 3.5.0
|
8 |
Tested up to: 5.3.2
|
9 |
+
Stable tag: 4.1.4
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
186 |
|
187 |
== Changelog ==
|
188 |
|
189 |
+
= 4.1.4 =
|
190 |
+
* Added: Up/Down subtotal voting support. [PRO]
|
191 |
+
* Added: 3 new templates. (Stackoverflow Votings, Badge Thumb, Star Thumb) [PRO]
|
192 |
+
* Added: HTML support for button custom text option.
|
193 |
+
* Added: Search field for the options panel.
|
194 |
+
* Removed: Old microdata display on front-end posts.
|
195 |
+
* Fixed: Anonymise IP issue.
|
196 |
+
* Fixed: An issue with comments auto display hook.
|
197 |
+
* Fixed: Some reported issues.
|
198 |
+
|
199 |
= 4.1.3 =
|
200 |
* Fixed: Problems with restoring old settings.
|
201 |
+
* Fixed: An issue in the bbPress option panel.
|
202 |
* Fixed: A simple issue with custom icons display.
|
203 |
* Fixed: Some default option values.
|
204 |
+
* Fixed: Button display issue on the blog page.
|
205 |
|
206 |
= 4.1.2 =
|
207 |
* Fixed: WPcolor js issue in the setting panel.
|
wp-ulike.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Plugin Name: WP ULike
|
11 |
* Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
|
12 |
* Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
|
13 |
-
* Version: 4.1.
|
14 |
* Author: Ali Mirzaei
|
15 |
* Author URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
|
16 |
* Text Domain: wp-ulike
|
@@ -46,7 +46,7 @@ if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
|
|
46 |
|
47 |
// Do not change these values
|
48 |
define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
|
49 |
-
define( 'WP_ULIKE_VERSION' , '4.1.
|
50 |
define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
|
51 |
define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
|
52 |
|
@@ -238,34 +238,14 @@ if ( ! class_exists( 'WpUlikeInit' ) ) :
|
|
238 |
* @return String
|
239 |
*/
|
240 |
public function get_ip() {
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
$
|
246 |
-
} elseif ( getenv( 'HTTP_X_FORWARDED' ) ) {
|
247 |
-
$ip = getenv( 'HTTP_X_FORWARDED' );
|
248 |
-
} elseif ( getenv( 'HTTP_FORWARDED_FOR' ) ) {
|
249 |
-
$ip = getenv( 'HTTP_FORWARDED_FOR' );
|
250 |
-
} elseif ( getenv( 'HTTP_FORWARDED' ) ) {
|
251 |
-
$ip = getenv( 'HTTP_FORWARDED' );
|
252 |
} else {
|
253 |
-
|
254 |
}
|
255 |
-
|
256 |
-
|
257 |
-
if ( ! filter_var( $ip, FILTER_VALIDATE_IP ) ) {
|
258 |
-
// Return local ip address
|
259 |
-
return '127.0.0.1';
|
260 |
-
} else {
|
261 |
-
|
262 |
-
if ( wp_ulike_is_true( wp_ulike_get_option( 'enable_anonymise_ip', false ) ) ) {
|
263 |
-
return $this->anonymise_ip( $ip );
|
264 |
-
} else {
|
265 |
-
return $ip;
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
}
|
270 |
|
271 |
/**
|
10 |
* Plugin Name: WP ULike
|
11 |
* Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
|
12 |
* Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
|
13 |
+
* Version: 4.1.4
|
14 |
* Author: Ali Mirzaei
|
15 |
* Author URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
|
16 |
* Text Domain: wp-ulike
|
46 |
|
47 |
// Do not change these values
|
48 |
define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
|
49 |
+
define( 'WP_ULIKE_VERSION' , '4.1.4' );
|
50 |
define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
|
51 |
define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
|
52 |
|
238 |
* @return String
|
239 |
*/
|
240 |
public function get_ip() {
|
241 |
+
// Get user IP
|
242 |
+
$user_ip = wp_ulike_get_user_ip();
|
243 |
+
// Check GDPR anonymise
|
244 |
+
if ( wp_ulike_is_true( wp_ulike_get_option( 'enable_anonymise_ip', false ) ) ) {
|
245 |
+
return $this->anonymise_ip( $user_ip );
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
} else {
|
247 |
+
return $user_ip;
|
248 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
}
|
250 |
|
251 |
/**
|