Skip to content

Commit

Permalink
Updated tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hchouhan committed Jun 26, 2024
1 parent 607fc27 commit 5823f40
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion i-recommend-this.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: I Recommend This
Plugin URI: https://themeist.com/plugins/wordpress/i-recommend-this/#utm_source=wp-plugin&utm_medium=i-recommend-this&utm_campaign=plugins-page
Description: This plugin allows your visitors to recommend or like your posts.
Version: 3.9.0
Version: 3.9.1
Author: Harish Chouhan, Themeist
Author URI: https://themeist.com/
Author Email: [email protected]
Expand Down
44 changes: 24 additions & 20 deletions js/dot_irecommendthis.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
jQuery(document).ready(function($) {
$(document).on('click', '.dot-irecommendthis', function() {
var link = $(this);
var unrecommend = link.hasClass('active');
var id = $(this).attr('id');
var suffix = link.find('.dot-irecommendthis-suffix').text();

// Generate a nonce
var nonce = dot_irecommendthis.nonce;
$(document).on('click', '.dot-irecommendthis', function(event) {
event.preventDefault();

$.post(dot_irecommendthis.ajaxurl, {
action: 'dot-irecommendthis',
recommend_id: id,
suffix: suffix,
unrecommend: unrecommend,
security: nonce, // Pass the nonce as part of the request
}, function(data) {
let title = unrecommend ? "Recommend this" : "You already recommended this";
link.html(data).toggleClass('active').attr('title', title);
});
var link = $(this);
var unrecommend = link.hasClass('active');
var id = link.attr('id');
var suffix = link.find('.dot-irecommendthis-suffix').text();

// Generate a nonce
var nonce = dot_irecommendthis.nonce;

return false;
});
$.post(dot_irecommendthis.ajaxurl, {
action: 'dot-irecommendthis',
recommend_id: id,
suffix: suffix,
unrecommend: unrecommend,
security: nonce // Pass the nonce as part of the request
}, function(data) {
var title = unrecommend ? "Recommend this" : "You already recommended this";
link.html(data).toggleClass('active').attr('title', title);
}).fail(function(xhr, status, error) {
console.error("Error: " + error);
});

return false;
});
});
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://themeist.com
Tags: recommend, like, love, post, rate, rating, post rating, heart, dribbble like, tumblr like
Requires at least: 6.0
Tested up to: 6.3.2
Stable tag: 3.9.0
Stable tag: 3.9.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -102,6 +102,9 @@ Please report security bugs found in the source code through the [Patchstack Vul

== Changelog ==

= 3.9.1
* Security update

= 3.9.0
* Added support for un-recommending/un-liking a post
* Fixed data sanitization
Expand Down

0 comments on commit 5823f40

Please sign in to comment.