WordPress plugin intelligence profile

Cookie Tasting

Detect user login only with cookie. The best helper for cached WordPress sites.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.5
Current version1.0.11
WordPress coverageTested up to WordPress 5.5
Minimum stackWP 5.0 · PHP 7.0
Directory statusactive
Last directory update27 Oct 20206y ago
Active installations10Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 1 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Cookie Tasting version 1.0.11 as active, updated 6y ago and tested up to WordPress 5.5.

Overview

About this plugin

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: 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.

login ) { // User is logged in. // If you use React... 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. preventDefault(); // Check cookie before do something. then( function( response ) { // Now user has fresh information.

// Load premium contents. catch( function( response ) { // This user is not logged in. // Redirect them to login page.

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.

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

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • cache
  • cookie
  • membership
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.5

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.5.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.5
Minimum requirementsWordPress 5.0 · PHP 7.0
Update activity27 Oct 20206y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.