PHPackages                             alimir/wp-ulike - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alimir/wp-ulike

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

alimir/wp-ulike
===============

WP ULike enables you to add Ajax Like button into your WP and allowing your visitors to Like/unLike the posts, comments, activities &amp; topics.

5.0.0(3mo ago)1081627[36 issues](https://github.com/Alimir/wp-ulike/issues)GPLv2 or laterPHP

Since May 30Pushed 2mo ago7 watchersCompare

[ Source](https://github.com/Alimir/wp-ulike)[ Packagist](https://packagist.org/packages/alimir/wp-ulike)[ Docs](https://wordpress.org/plugins/wp-ulike)[ RSS](/packages/alimir-wp-ulike/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (60)Used By (0)

WP ULike
========

[](#wp-ulike)

**The Ultimate WordPress Engagement Plugin** - Add Like &amp; Dislike buttons to posts, comments, WooCommerce products, BuddyPress activities, and bbPress topics. Track engagement with comprehensive statistics and analytics.

[![WordPress](https://camo.githubusercontent.com/f1989d6cd7139e0ba03c225b1eb47980a7ec6ba2a2b489beb9c01881be322852/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d362e302532422d626c75652e737667)](https://wordpress.org/)[![PHP](https://camo.githubusercontent.com/ca176f61554e5a86e504841a3ea5b0a022b7868fed8ac3d5fcf1f6cc90c5702d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e322e352532422d707572706c652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/8073c688156d52b13280b49cdcac0864bd833075668eada38c76550490ffb46f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c76322d677265656e2e737667)](https://www.gnu.org/licenses/gpl-2.0.html)

---

🚀 Features
----------

[](#-features)

- **Universal Support** - Works with Posts, Comments, WooCommerce Products, BuddyPress Activities, and bbPress Topics
- **Fast &amp; Lightweight** - Vanilla JavaScript (no jQuery), optimized for performance
- **Customizable Templates** - Multiple button styles and templates
- **Statistics Dashboard** - Track engagement with detailed analytics
- **Developer-Friendly** - Extensive hooks, filters, and functions for customization
- **GDPR Ready** - IP anonymization, no personal data stored
- **RTL Support** - Full right-to-left language support
- **Multilingual** - 20+ language translations included

---

📦 Installation
--------------

[](#-installation)

### Via WordPress Admin

[](#via-wordpress-admin)

1. Go to **Plugins → Add New**
2. Search for "WP ULike"
3. Click **Install Now** and then **Activate**

### Manual Installation

[](#manual-installation)

1. Download the latest release: `https://github.com/Alimir/wp-ulike/archive/master.zip`
2. Extract and upload to `/wp-content/plugins/`
3. Activate through the **Plugins** menu

### Via Git

[](#via-git)

```
git clone https://github.com/Alimir/wp-ulike.git wp-content/plugins/wp-ulike
```

---

🎯 Quick Start
-------------

[](#-quick-start)

After activation, go to **WP ULike → Settings** and enable "Auto Display" for your desired content types (Posts, Comments, etc.).

### Basic Usage

[](#basic-usage)

**Display Like Button:**

```
[wp_ulike]

```

**In PHP Templates:**

```
echo do_shortcode('[wp_ulike for="post" id="123"]');
```

**💡 Need Custom HTML Structure?** You can create fully customizable templates with complete control over HTML structure and button positioning. See the [Custom Templates section](#-custom-templates---full-html-control) in Developer Functions or jump to [Template &amp; Query Filters](#template--query-filters) for complete examples.

---

📚 Shortcodes
------------

[](#-shortcodes)

### `[wp_ulike]` - Main Like Button

[](#wp_ulike---main-like-button)

Display the like/dislike button for any content type.

**Parameters:**

- `for` (string) - Content type: `post`, `comment`, `activity`, `topic`
- `id` (integer) - Specific item ID (optional, auto-detected in loops)
- `style` (string) - Template style name
- `button_type` (string) - Button type: `image` or `text`
- `wrapper_class` (string) - Additional CSS class

**Examples:**

```
[wp_ulike for="post"]
[wp_ulike for="comment" style="wpulike-heart"]
[wp_ulike for="post" id="123" button_type="text"]

```

### `[wp_ulike_counter]` - Display Counter

[](#wp_ulike_counter---display-counter)

Show the number of likes/dislikes.

**Parameters:**

- `id` (integer) - Item ID (optional, auto-detected)
- `type` (string) - Content type: `post`, `comment`, `activity`, `topic`
- `status` (string) - Vote status: `like`, `unlike`, `dislike`, `undislike`
- `date_range` (string) - Date range filter
- `past_time` (integer) - Hours in the past

**Examples:**

```
[wp_ulike_counter type="post" status="like"]
[wp_ulike_counter type="comment" past_time="24"]

```

### `[wp_ulike_likers_box]` - Display Likers List

[](#wp_ulike_likers_box---display-likers-list)

Show a list of users who liked the content.

**Parameters:**

- `id` (integer) - Item ID (optional, auto-detected)
- `type` (string) - Content type: `post`, `comment`, `activity`, `topic`
- `counter` (integer) - Number of users to display (default: 10)
- `template` (string) - Custom template HTML
- `style` (string) - Display style
- `avatar_size` (integer) - Avatar size in pixels (default: 64)

**Example:**

```
[wp_ulike_likers_box type="post" counter="5" avatar_size="48"]

```

---

💻 Developer Functions
---------------------

[](#-developer-functions)

> **Note:** All functions are prefixed with `wp_ulike_` and should be checked for existence before use in themes/plugins for compatibility.

### 🎨 Custom Templates - Full HTML Control

[](#-custom-templates---full-html-control)

**Need complete control over button HTML structure and positioning?** Create custom templates with full control over the HTML output. This allows you to place like/dislike buttons anywhere in your code with any HTML structure you need.

**Quick Example:**

```
// Register custom template
add_filter('wp_ulike_add_templates_list', 'my_custom_template', 10, 1);
function my_custom_template($templates) {
    $templates['my-template'] = array(
        'name'            => 'My Custom Template',
        'callback'        => 'my_template_callback',
        'is_text_support' => true
    );
    return $templates;
}

// Custom template with full HTML control
function my_template_callback($args) {
    extract($args);
    ob_start();
    ?>
