Giter Site home page Giter Site logo

alimir / wp-ulike Goto Github PK

View Code? Open in Web Editor NEW
102.0 8.0 29.0 13.07 MB

WP ULike enables you to add Ajax Like button into your WordPress and allowing your visitors to like and unlike posts,comments, BuddyPress activities & bbPress Topics

Home Page: http://alimir.github.io/wp-ulike/

PHP 52.80% CSS 7.31% JavaScript 36.83% SCSS 3.07%
wordpress wordpress-plugin php bbpress likers like-button buddypress mycred-plugin ultimate-member statistics

wp-ulike's Introduction

WP ULike GitHub Repository

If you’re looking for one of the best and fastest ways to add like and dislike functionality to your WordPress website, then the WP ULike plugin is for you! WP ULike is our ultimate solution to cast voting to any type of content you may have on your website. With outstanding and eye-catching widgets, you can have Like and Dislike Button on all of your contents would it be a Post, Comment, Activities, Forum Topics, WooCommerce products, you name it. Now you can feel your users Love ❤️ for each part of your work.

It's time for WP ULike.

Features

  • Clean Design + Some standard eye-catching templates.
  • Professional Schema.org generator for each post type. [PRO]
  • Full Elementor Page Builder Support. [PRO]
  • Dislike button support with +8 creative templates. [PRO]
  • Display the likers of each button in linear or pop-up mode.
  • Simple, Stylish and user-friendly settings to easily customize your plugin.
  • Extract detailed reports and beautiful, useful and simple charts in an instant.
  • Support Custom Post Types, Comments, Activities & Topics.
  • Using various hooks and functions, you can easily customize this plugin.
  • We’re light-weight, fast, responsive and compatible with Google Schemas.
  • Full myCRED (points management system) Points Support.
  • Supporting UltimateMember & BuddyPress Profiles.
  • Ajax feature to update the data without reloading.
  • Visitors do not have to register or log in to use the Like Button.
  • Added automatically with filtering options (no Code required).
  • Different logging method options. (Cookie, IP, Username)
  • Notifications System. (Custom toast messages after each activity)
  • Flexible Shortcode with variable support.
  • Supporting the date in a localized format. (date_i18n)
  • BuddyPress adds activity & notifications support.
  • Simple custom style with color picker settings.
  • Support RTL & +20 language files.

More Information

Installation

For detailed setup instructions, visit the official Documentation page.

  1. You can clone the GitHub repository: https://github.com/Alimir/wp-ulike.git
  2. Or download it directly as a ZIP file: https://github.com/Alimir/wp-ulike/archive/master.zip

This will download the latest developer copy of WP ULike.

How To Use this plugin?

After installing and activating the plugin, go to the Settings panel and enable the "Auto Display" option for your target section (Currently for: Posts, Comments, BuddyPress activities & bbPress Topics.). Otherwise, you can use the manual way.

In order to insert Like button inside a content use the following shortcode:

Display CTA button

[wp_ulike]

Parameters ( attributes ):

  • for (string) - select button type (Availabe Values: post, comment, activity, topic)
  • id (integer) - select specific item ID. (For manual usage)
  • button_type (string) - Set Button Type (Availabe Values: image, text)
  • style (string) - Choose the default template from the available list.
  • wrapper_class (string) - Extra Wrapper class

Using shortcode in the PHP template:

echo do_shortcode('[wp_ulike for="post" id="1" style="wpulike-heart"]');

How To Change The Counter Format?

Just add a filter on wp_ulike_format_number. e.g. If you want to remove + character, you need to make use of the sample code below:

add_filter('wp_ulike_format_number','wp_ulike_new_format_number',10,3);
function wp_ulike_new_format_number($value, $num, $plus){
	if ($num >= 1000 && get_option('wp_ulike_format_number') == '1'):
	$value = round($num/1000, 2) . 'K';
	else:
	$value = $num;
	endif;
	return $value;
}

How To Remove "0" Count If There Are No Likes?

Make use of the wp_ulike_count_box_template filter as shown in the sample code below:

add_filter('wp_ulike_count_box_template', 'wp_ulike_change_my_count_box_template', 10, 2);
function wp_ulike_change_my_count_box_template($string, $counter) {
	$num = preg_replace("/[^0-9,.]/", "", $counter);
	if($num == 0) return;
	else return $string;
}

How To Change The Login Alert Template?

Make use of the wp_ulike_login_alert_template filter as shown in the sample code below:

add_filter('wp_ulike_login_alert_template', 'wp_ulike_change_login_alert_template', 10);
function wp_ulike_change_login_alert_template(){
	return '<p class="alert alert-info fade in" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>Please login to your account! :)</p>';
}

How To Get Post Likes Number?

Make use of the following function in WP Loop:

if (function_exists('wp_ulike_get_post_likes')):
	echo wp_ulike_get_post_likes(get_the_ID());
endif;

How To Get Comment Likes Number?

Make use of the following function in your comments loop:

if (function_exists('wp_ulike_get_comment_likes')):
	echo wp_ulike_get_comment_likes(get_comment_ID());
endif;

How To Sort Most Liked Posts?

Make use of the following query on a loop:

/**
 * Get most liked posts in query
 *
 * @param integer $numberposts		The number of items
 * @param array|string $post_type	Select post type
 * @param string $method			keep this as default value (post, comment, activity, topic)
 * @param string $period			Date period (all|today|yeterday|week|month|year)
 * @param string $status			Log status (like|unlike|dislike|undislike)
 * @return WP_Post[]|int[] 			Array of post objects or post IDs.
 */
$wp_query = wp_ulike_get_most_liked_posts( 10, array( 'post' ), 'post', 'all', 'like' );

How Can I Create Custom Template In Users Liked Box?

We have provided some variables in setting panel. You can use them in textarea and then save the new options. Attention: %START_WHILE% And %END_WHILE% variables are very important and you should use them out of the frequent string. (Such as <li></li> tags sample in default template)

Receive HTTP ERROR 500 on WP ULike > Statistics

Increasing Your WordPress Memory Limit in wp-config.php to fix this error. It is located in your WordPress site's root folder, and you will need to use an FTP client or file manager in your web hosting control panel. Next, you need to paste this code in wp-config.php file just before the line that says That's all, stop editing! Happy blogging.

define( 'WP_MEMORY_LIMIT', '256M' );

Bugs

If you find an issue, let us know here!

Support

Please visit the support forums.

wp-ulike's People

Contributors

alimir avatar contemplate avatar hozerapha avatar m4v1 avatar pixeleffect avatar tblobaum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-ulike's Issues

Corrections to wp-ulike/assets/css/wp-ulike.css (and .min.) for validation

The file wp-ulike/assets/css/wp-ulike.css contains four specifications of animation-delay which lack the time unit and thus fail validation by the W3C CSS validator. Here are the patches applied at our site commenting out the original erroneous CSS and replacing it with specifications including the time unit. When the base file is updated, the wp-ulike.min.css must, of course, be re-generated. Line numbers are current as of 4.1.7 and several earlier versions.

487,488d483
< /* RATBURGER LOCAL CODE
< Fix validation error.
490,492d484
< /
< animation-delay: .45s;
< /
END RATBURGER LOCAL CODE /
502,503d493
< /
RATBURGER LOCAL CODE
< Fix validation error.
505,507d494
< /
< animation-delay: 0s;
< /
END RATBURGER LOCAL CODE /
522,523d508
< /
RATBURGER LOCAL CODE
< Fix validation error.
525,527d509
< /
< animation-delay: .2s;
< /
END RATBURGER LOCAL CODE */

show like button in a loop

Hi every one.

Im trying to put the like button inside de loop pf search result. When click the button show a red a lert saying and error was ocurred
image

can any one helpme?

Tooltip not working in version 3.0

Hello, I am currently running version 3.0 of WP ULike on my website, and for some reason the Tooltip functionality is no longer working? When running version 2.7, if a user was logged out and hovered over the thumbs-up they would get a small pop-up tooltip that said “Please login to like comments or posts”, but now that I’ve upgraded to 3.0, that message no longer appears. Looking at the wp-ulike.min.css file, it looks like all of the css classes for the tooltip have been removed. Is there a new way to achieve this functionality that I’m just not seeing?

Thank you in advance for your help!

popup issue

Hi we face bug in using popup with wp-ulike plugin. if wp-ulike is enabled, my popup doesn't work.
please check it, i'm waiting for your answer

Start Like button with a minimum number != 0. And new post automattic likes plus 1 than the most liked post

Hi friends,

First of all congrats for the plugin...

Have done some customisations taking code from the readme. Removed 0 and plus. Problem. Got a site issue and could not solved. No other solution than remove these code...

Now I want that LIKE button starts with a minimum number different than 0. Example: 4.

Also want that when a new post is posted it gets the same likes than the most liked plus 1 more.

Is all this possible? Any suggestion will be highly appreciated.

Wish you a great day

Version 3.6

Why in the repository WP is 3.6 version and here only is 3.5.2 version ?

order by issue

I am trying to order my posts by using order by likes, but this does not return posts which have not been voted yet.

There is a list of custom posts, I ordered it by number of likes but it does not returns the newly created posts on which no voting has been done yet.

$query     = array(
	"post_type" => "books",
	'orderby' 	=> 'meta_value_num',
	'meta_key'  => '_liked',
); 
$the_query = new WP_Query( $query );

Error 2: If I use any meta key selector in query args & also use orderby then order by meta key & value replaces other meta key value.

$query     = array(
	"post_type"      => "books",
	"meta_key"	=>"is_read",
	"meta_value"    =>1,
	'orderby' 	=> 'meta_value_num',
	'meta_key'        => '_liked',
);
$the_query = new WP_Query( $query );

SQL: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( ( wp_postmeta.meta_key = '_liked' AND wp_postmeta.meta_value = '1' ) ) AND wp_posts.post_type = 'books' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_author = 4 AND wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 DESC LIMIT 0, 10

Cannot delete individual Logs

Clicking the delete button for individual like logs is giving a 404 error.
POST https://domain.com/wp-admin/admin-ajax.php 404
  | (anonymous) | @ | VM753:1
  | send | @ | jquery.js:4
  | ajax | @ | jquery.js:4
  | (anonymous) | @ | statistics.js?ver=5.3.2:13
  | dispatch | @ | jquery.js:3
  | r.handle | @ | jquery.js:3

Add like programmatically

Hi,

I'm creating a plugin to import data from Jetpack Likes (Wordpress.com) to Wp ULike.

What would be the correct way to add a like programmatically via PHP?
I wanna pass the USER_ID and POST_ID.

"Users Like Box Template" does not display

Hi there, tanx for your nice work.

I am facing deep problem with the plugin... I am intending to record likes on comments, only for registrer users and I need to be able to count the number of likes per user and per comment. But...

1/ nothing is recorded in the table '_ulike_comments'
2/ I can like again and again the sames contents.... my previous likes ar not taken into account (i am using the 'Logged by username' Login method
3/ the "Users Like Box Template" only prints "%START_WHILE% %USER_AVATAR%
%END_WHILE%" in the front end...

Can you help me please?

Regards

Idea: Instead of thumbs up, clapping possible?

The idea to have thumbs up are good, but therefore everyone has only one time to vote for something. Is it possible to have something like a clapping-function as well? Maybe the admin has to decide for one concept, but that would bring a new dimension to it. Of course the way would only be one direction, but how much something is favorited would be more clearly.

Some parts are missing the translation placeholder

The text shown below shows up on the news feed of buddypress when someone liked a post.

Problem: it is not possible to translate the string because the __() is missing. Can this please be added, its only a matter of seconds to include.

Thank you!

file:

  • general-functions.php
  • general-hooks.php

string:
(So far, This post has %POST_COUNT% likes)

How to disable aggregateRating schema metadata?

I installed WP ULike plugin on my local fresh installation of WP. I followed the steps to remove all schema data. But I still see a aggregateRating field which throws errors on Google structured data testing tool.
image

Any way to remove it?

How to load the JS but not the CSS files on Buddypress pages?

I see the option to not load the CSS and JS files on certain pages but how do you split these? I'm using an app builder and this is causing layout issues in my mobile app, I'd like to load the JS file but not the CSS file as I think that's what's causin the issue.
To be clearer: The plugin works fine but causes the text in my mobile app to extend off-screen to the right inside a Buddypress group. If I exclude the Buddypress pages from loading the CSS and JS files, this doesn't happen but the button appears solid and no longer functional.

Button not accessible

Hi there, thanks for this nice looking plugin.

I found out that the like button is not accessible with the keyboard because of the missing href attribute. Moreover, the semantically better way would be to use the <button> element instead of <a>.

No data is being stored in the database

Im on a fresh WP 4.9.6 install running PHP7. Upon clicking the like button, it infinitly increases the count no matter if I am logged in or not.
But NO datas are stored in the database?!

Whats going on there?

ULike + Buddypress notifications not working

No errors, nothing at all. It just doesn't work. I am not getting any notifications at all. Nothing via Buddypress, nothing via activities... really nothing.

Is there a way to get this fixed?

Some Likes not saving for users

I love this plugin and we are about to deploy it on a large membership site for members to like certain custom post types. Everything was working smoothly until we began testing with some initial users.

Some have reported that the likes don’t save. As soon as the page is refreshed the likes are gone for them. Others are having no problems. The latest update did not fix the issue and there are no errors in the error logs.

It appears to be an IP related issue. All test users with an IPv6 it won't save the Likes.

We use the username method for logging. But every user who it doesn’t save the likes for has an IPv6 address while IPv4 users it works fine. It doesn’t appear that this should be an issue with username logging.

A few users have switched their phones to use cell data and the buttons work fine. Then when they switch back to wifi the buttons don’t work. I'm guessing this is b/c their cell data IPs are IPv4.

We are hosted on a dedicated server with WP Engine. We also use Cloudflare.

Has anyone come across something like this? I can’t even replicate it so have had to rely on video observation with some beta testers.

Count is not updating

If user is not logged in, he/she is not able to like the post. He/she is only able to click on like button once however count is not getting updated. Please give me direction on this.

Unlike Button

Hello,

i wish a unlike Button too and not only a like Button.

I mean something like this:
image

Problem with wordpress REST API `/wp-json/wp/v2/comments` endpoint

When accessing the above-mentioned endpoint with wp-ulike plugin installed, the following notice is generated:

Notice: Trying to get property 'comment_ID' of non-object in /var/www/html/wp-includes/comment-template.php on line 673

This renders the JSON invalid. On debugging I found that wp_ulike_comments() function calls get_comment_ID which depends on the global $GLOBALS['comment'] to get the current comment. This variable is set by an instance of Walker_Comment class (or its subclass), which is instantiated in the get_comment_pages_count function of the file wp-includes/comment.php. Probably this function is not called when accessing the comments endpoint through rest API, and hence the notice.

I know I can set the WP_DEBUG flag to false and get rid of the notice, but this seems like broken.

one post in a given category?!

Is it possible to make it so that the user can like only 1 post within the same category of posts? And when the user "likes" another post within the same category, the first one would be automatically unliked?

Performance issue with in 4.x because of switch to custom database table

Hi there,

It looks like when you switched from using post meta to your custom database table you subsequently created some performance issues as you've almost completely sidestepped WordPress's built-in caching mechanisms.

Post meta automatically uses the built-in object caching, and thus any persistent caching (ie. Redis etc.) hooking into the built-in object offers great benefits in more demanding cases.

By using your custom table and subsequently custom database queries, you completely miss this advantage and thus possibly execute a whole lot of unnecessary db queries.

In the simplest form you should at least utilize wp_cache_set()/wp_cache_add() and wp_cache_get() with your custom queries.

You actually already do once but I'm not sure why you haven't in all the different queries related to like count data.

I know caching is always harder than it seems and I would actually appreciate even more robust configurable caching options, but this seems like a low hanging fruit.

Problem with bbPress

Hi,

This is a great plugin and really great works. I'm using it on one of my clients site and found a bug with bbPress. I fixed it on my installation but it would be better if you update the plugin after fix.

You have a typo with $replyID variable at the last line of following code, and it's in inc/wp-ulike.php and line no: about 244

$replyID = bbp_get_reply_id();
$post_ID = !$replyId ? $post->ID : $replyID;

Feature request: Customizing the icon size

This is a plugin that I really like, but I find that it doesn't have a feature of customizing the icon size, which is sometimes too large for some themes. Could you please consider adding this simple feature in the future updates? thx.

List the most like comments in the article.

$comment_query = new WP_Comment_Query( array(
		        'post_id' => get_the_ID(),
		        'meta_key' => '_commentliked',
		        'meta_query' => array(
                    array(
                        'key' => '_commentliked',
                        'value' => '0',
                        'compare' => '>'
                    )
                ),
		        'orderby' => 'meta_value_num',
		        'number' => 3
		        ) );
            wp_list_comments('type=comment&callback=zan_comment&end-callback=zan_end_comment',$comment_query->comments);

           wp_list_comments('type=comment&callback=cm_comment&end-callback=cm_end_comment&max_depth=23');

Hello there.
I use the code above to list the most like comments.
There is also a wp_list_comments listed below for all comments.
At this time, there was a problem with the paging.
The page shows the comment on the first page, which is actually not the case.

Is there any solution?
Or a better way to achieve this.

Does not seem to work outside of loop (post)

I tried to add both shortcode and wp_ulike( 'get' ); to post's sidebar (outside of loop) but it does not seem to work at all. If I move the code inside post's content it works.

(MySQL 8) Incorrect DATETIME value: ''

MySQL 8 running in strict mode (default) doesn't support empty string as a valid datetime value. Hence the plugin crashes with the abovementioned error.

Failing query is:

SELECT
( SELECT COUNT(*) FROM `wp_ulike` WHERE ( date_time <= NOW() AND date_time >= "" ) ) +
( SELECT COUNT(*) FROM `wp_ulike_activities` WHERE ( date_time <= NOW() AND date_time >= "" ) ) +
( SELECT COUNT(*) FROM `wp_ulike_comments` WHERE ( date_time <= NOW() AND date_time >= "" ) ) +
( SELECT COUNT(*) FROM `wp_ulike_forums` WHERE ( date_time <= NOW() AND date_time >= "" ) )

avatar linking to current user profile instead of “liker's” profile

If user A "likes" a post, upon refreshing the page it will show +1 like on that post, and it also shows that user's avatar which should link to that user's profile.

Now the problem is that the URL is linking to the Current user's profile, instead of properly linking to User A's profile.

So let's say I am logged into my account. I go to look at the user who liked the post. Well, the avatar is showing user A's image (as it should) but his avatar is linking to My profile. This problem occurs when there is one like on the post.

Now, when there are two likes on the post(say, from two users not including myself) it will show both of the 2 users' avatars. Now when I go to click to view their profile.. user A still links to the current user (my profile) while the second user's avatar (user B) links to user A's profile

Additional Question:
Also In the Most liked user widget, The liker avatar is not linking their profile, Please highlight the code need to be changed to works fine.

Sort log table

Hello,

great plugin. It would be very helpful if the table ‘Post Likes Logs’ would be sortable. Is it possible to realize this feature?

Best regards
Sarah

Frontend label should have title attribute

Right now frontend content is wrapped in <label>.

It would be ideal to have a title attribute so users could see the action that will be performed, eg <label title="Like this {contentType}">.

function to get current user liked comment

Hi, I think this plugin need to be more documented and need more customize able function specially for change UI.
I am looking for a PHP function to know current user was liked this comment or no?
thanks

Filtering counter template doesn't work with AJAX

I was trying to use the wp_ulike_count_box_template filter suggested here. in order to add some text to the counter number. for instance "10 people liked this post" or "1 person liked this post" etc. this is working on page first load, but the text is not changing on click. I don't know if this is a problem in my code, or that something is missing in the original hook.
here is my script:
add_filter('wp_ulike_count_box_template', 'bayadaim_ulike_count', 10, 2); function bayadaim_ulike_count($string, $counter) { $num = preg_replace("/[^0-9,.]/", "", $counter); if($num == 0) $string = "<span class='didit-counter'>Be the first one to Like!</span>"; elseif($num == 1) $string = "<span class='didit-counter'>".$string." Person liked this</span>"; else $string = "<span class='didit-counter'>".$string." People liked this</span>"; return $string; }

Thanks,
Itamar

[major bug] ulike breaking most buddypress notificaitons

This has been driving me crazy FOREVER. when someone replys to my forum threads, I have been getting notifications with blank titles, so I have no idea what the notification is, I just went through and disabled all my plugins 1 by 1 to find out its ulike breaking titles in the notifications page.

This is a major bug that is affecting all our existing website stopping notifications being displayed.

With ulike activated:
https://i.imgur.com/iDLench.png

With ulike disabled:
https://i.imgur.com/8HzXtsP.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.