Title: Cookie Tasting
Author: TAROSKY INC.
Published: <strong>مارچ 14, 2019</strong>
Last modified: اکتوبر 27, 2020

---

پلگ انز تلاش کریں

![](https://ps.w.org/cookie-tasting/assets/banner-772x250.jpg?rev=2050214)

یہ پلگ ان **ورڈپریس کے تازہ ترین 3 ریلیزوں کے ساتھ ٹیسٹ نہیں کیا گیا ہے**۔ اب یہ
برقرار نہیں رکھا جا سکتا یا معاونت نہیں کی جا سکتی اور اس کو ورڈپریس کے تازہ ترین
ورژنز کے ساتھ استعمال کیے جانے پر مطابقت کے مسائل ہو سکتے ہیں۔

![](https://ps.w.org/cookie-tasting/assets/icon-256x256.jpg?rev=2050214)

# Cookie Tasting

 منجانب [TAROSKY INC.](https://profiles.wordpress.org/tarosky/)

[ڈاؤن لوڈ کریں](https://downloads.wordpress.org/plugin/cookie-tasting.1.0.11.zip)

 * [تفصیلات](https://ur.wordpress.org/plugins/cookie-tasting/#description)
 * [جائزے](https://ur.wordpress.org/plugins/cookie-tasting/#reviews)
 *  [انسٹالیشن](https://ur.wordpress.org/plugins/cookie-tasting/#installation)
 * [ڈیولپمنٹ](https://ur.wordpress.org/plugins/cookie-tasting/#developers)

 [معاونت](https://wordpress.org/support/plugin/cookie-tasting/)

## تفصیل

This plugin sets user cookie when user is logged in.
 You can use cookie as data
store, so you can use it as UI resource.

#### Visibility

This plugin adds class to `html` element.

 * `ct-logged-in` The current user is logged in.
 * `ct-not-logged-in` The current user is anonymous.

You can control elements visibility with CSS.

    ```
    .some-element{
      display: none;
    }
    .ct-logged-in .some-element{
      display: block;
    }
    ```

#### From JavaScript

You can use Global Object `CookieTasting` for utility.

 * `CookieTasting.userName()` Returns user name. If not logged in, returns ‘Guest’.
 * `CookieTasting.lastUpdated()` Returns timestamp of last log in check. If this
   equals 0, it means that user is anonymous.

Besides that, this plugin checks periodically log-in status.
 You can handle it 
with jQuery.

    ```
    jQuery( document ).on( 'cookie.tasting', function( event, response ) {
      if ( response.login ) {
        // User is logged in.
        // If you use React...
        setAttributes({ name: CookieTasting.userName() })
      } else {
        // User is not logged in.
      }
    } );
    ```

If you use react or something, updated the status with `setState()`.

#### Check Before Action

If you manage cached WordPress and customizing your own theme,
 It’s a good idea
to implement dynamic UI components with JavaScript.

You can check user’s credential just before important actions.

    ```
    // Click action for button.
    $('.read-more').click( function( e ) {
      e.preventDefault();
      // Check cookie before do something.
      CookieTasting.testBefore().then( function( response ) {
        // Now user has fresh information.
        // Load premium contents.
        loadPremiumContents();
      }).catch( function( response ) {
        // This user is not logged in.
        // Redirect them to login page.
        window.locaion.href = '/wp-login.php';
      } );
    } );
    ```

Plese remember adding dependency for `cookie-tasting-heartbeat` to your script.

#### Handle UUID

By default, this plugin set UUID for each user. This will be…

 * Unique for each logged in user and will be saved as user_meta.
 * Also kept for anonymous user.

So you can use it for Google Analytic’s [User ID View](https://support.google.com/analytics/answer/3123662).

    ```
    const uuid = CookieTasting.get( 'uuid' );
    // For Google Analytics.
    ga( 'set', "userId", uid );
    ```

## انسٹالیشن

 * Download zip file and unpack it.
 * Upload the directory to `wp-content/plugins`.
 * Go to WordPress admin screen and activate this plugin.

**Recommendation:** Search on WordPress admin screen and install it.

## عمومی سوالات

### How to Contribute

This plugin is hosted on [Github](https://github.com/tarosky/cookie-tasting).
 Please
feel free to make issue or send pull requests.

## جائزے

![](https://secure.gravatar.com/avatar/b1738118b1515a2c312e90b71dc041a57a90db61144063f36de6b27587b507d6?
s=60&d=retro&r=g)

### 󠀁[nice idea !!!](https://wordpress.org/support/topic/nice-idea-39/)󠁿

 [Toro_Unit (Hiroshi Urabe)](https://profiles.wordpress.org/toro_unit/) اپریل 27,
2019

nice idea !!!

 [ تمام 1 جائزے پڑھیں ](https://wordpress.org/support/plugin/cookie-tasting/reviews/)

## شراکت دار اور ڈیویلپرز

“Cookie Tasting” اوپن سورس سافٹ ویئر ہے۔ مندرجہ ذیل لوگوں نے اس پلگ ان میں حصہ لیا:

شراکت دار

 *   [ TAROSKY INC. ](https://profiles.wordpress.org/tarosky/)
 *   [ Fumiki Takahashi ](https://profiles.wordpress.org/takahashi_fumiki/)

“Cookie Tasting” کا 1 زبان میں ترجمہ کیا گیا ہے۔ تعاون کے لیے [مترجمین](https://translate.wordpress.org/projects/wp-plugins/cookie-tasting/contributors)
کا شکریہ۔

[“Cookie Tasting” کا اپنی زبان میں ترجمہ کریں۔](https://translate.wordpress.org/projects/wp-plugins/cookie-tasting)

### ڈویلپمینٹ میں دلچسپی ہے؟

[کوڈ براؤز کریں](https://plugins.trac.wordpress.org/browser/cookie-tasting/)، [ایس این وی ریپوزیٹری](https://plugins.svn.wordpress.org/cookie-tasting/)
کو چیک کریں یا [ڈویلپمینٹ لاگ](https://plugins.trac.wordpress.org/log/cookie-tasting/)
کو سبسکرائب کریں بذریعہ [آر ایس ایس](https://plugins.trac.wordpress.org/log/cookie-tasting/?limit=100&mode=stop_on_copy&format=rss)۔

## چینج لاگ

#### 1.0.11

 * Display `console.log` only if `SCRIPT_DEBUG` is true.

#### 1.0.10

 * Bugfix: Add polyfil for `Object.assign` in favor of lte IE11.
    (Props [@Kamata Ryo](https://github.com/kamataryo)).

#### 1.0.9

 * Bugfix nonce refreshing for cached page.

#### 1.0.8

 * Add filter for Cookie check API. Now you can change error message.

#### 1.0.7

 * Fix UUID logic.
 * Add automatic refresh for rewrite rules.

#### 1.0.6

 * Fix SSL bug.

#### 1.0.5

 * Fix fatal error. `vendor` directory was missing.

#### 1.0.4

 * Update nonce for [@wordpress/wp-api-featch](https://wordpress.org/gutenberg/handbook/designers-developers/developers/packages/packages-api-fetch/)
   and `wpApiSettings` of [wp-api](https://developer.wordpress.org/rest-api/using-the-rest-api/backbone-javascript-client/).
 * Change REST API endpoit because it requires COOKIES properly set. The endpoint`
   wp-json/cookie/v1/nonce` is pseudo and it’s not REST API actually, so you can
   refresh nonce with this endpoint. Normally, this refresh will be executed automatically,
   but if you get "rest_cookie_invalid_nonce”, try updating permalink from "Setting
   > Permalink”. Just click "Save” and that’s it.
 * UUID will be set for current user. It’s userful for tracking.

#### 1.0.3

 * Add filter to cookie detection API.

#### 1.0.2

 * Bugfix: if home url is not SSL, cookie `$secure` flag is now false.
    But we sincerely
   recommend protecting your site under SSL.

#### 1.0.0

 * Initial release.

## میٹا

 *  Version **1.0.11**
 *  Last updated **6 سال پہلے**
 *  Active installations **10+**
 *  WordPress version ** 5.0 یا اس سے جدید **
 *  Tested up to **5.5.18**
 *  PHP version ** 7.0 یا اس سے جدید **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/cookie-tasting/) اور [Japanese](https://ja.wordpress.org/plugins/cookie-tasting/).
 *  [اپنی زبان میں ترجمہ کریں](https://translate.wordpress.org/projects/wp-plugins/cookie-tasting)
 * Tags
 * [cache](https://ur.wordpress.org/plugins/tags/cache/)[cookie](https://ur.wordpress.org/plugins/tags/cookie/)
   [membership](https://ur.wordpress.org/plugins/tags/membership/)
 *  [اعلی درجے کا منظر](https://ur.wordpress.org/plugins/cookie-tasting/advanced/)

## درجہ بندیاں

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/cookie-tasting/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/cookie-tasting/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/cookie-tasting/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/cookie-tasting/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/cookie-tasting/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/cookie-tasting/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/cookie-tasting/reviews/)

## شراکت دار

 *   [ TAROSKY INC. ](https://profiles.wordpress.org/tarosky/)
 *   [ Fumiki Takahashi ](https://profiles.wordpress.org/takahashi_fumiki/)

## معاونت

کچھ کہنا ہے؟ مدد چاہیے؟

 [معاونتی فورم دیکھیں](https://wordpress.org/support/plugin/cookie-tasting/)