Title: Now Playing Widget for Spotify
Author: tuliocareli
Published: <strong>November 24, 2026</strong>
Last modified: November 24, 2026

---

Search plugins

![](https://ps.w.org/now-playing-widget-for-spotify/assets/banner-772x250.png?rev
=3821423)

![](https://ps.w.org/now-playing-widget-for-spotify/assets/icon-256x256.png?rev=
3821423)

# Now Playing Widget for Spotify

 By [tuliocareli](https://profiles.wordpress.org/tuliocareli/)

[Download](https://downloads.wordpress.org/plugin/now-playing-widget-for-spotify.1.1.0.zip)

 * [Details](https://wordpress.org/plugins/now-playing-widget-for-spotify/#description)
 * [Reviews](https://wordpress.org/plugins/now-playing-widget-for-spotify/#reviews)
 *  [Installation](https://wordpress.org/plugins/now-playing-widget-for-spotify/#installation)
 * [Development](https://wordpress.org/plugins/now-playing-widget-for-spotify/#developers)

 [Support](https://wordpress.org/support/plugin/now-playing-widget-for-spotify/)

## Description

Instead of relying on heavy third-party embeds or exposing Spotify API keys to visitors’
browsers (a critical security risk), this plugin provides a clean, native, and highly
performant way to show your website visitors what you are currently listening to
on Spotify.

The **Now Playing Widget for Spotify** was built strictly according to WordPress
Coding Standards, optimal front-end performance, and frictionless UX. It presents
a modern, floating Glassmorphism UI using the `[npwfs_now_playing]` shortcode.

### Features

 * **1-Click OAuth2 Setup:** Connect your Spotify account securely through the WordPress
   admin dashboard with a single button click. No terminal commands, curl scripts,
   or manual token handling required.
 * **CSRF-Protected Handshake:** OAuth state parameters are validated using WordPress
   cryptographic nonces to protect your administration session.
 * **Zero Credential Exposure:** Communication with the Spotify API occurs strictly
   server-to-server. Client Secrets and Refresh Tokens are stored safely in your
   database and are never delivered to visitor browsers.
 * **Intelligent Two-Tier Caching:** Spotify access tokens are cached server-side
   until near expiration. Public track requests use WordPress Transients (30-second
   TTL by default) to keep page loads instant and stay safely within Spotify rate
   limits.
 * **Idle / Last Played State:** When you are not playing music, the widget seamlessly
   displays the last track from your playback history with subtle visual styling.
 * **Battery & Network Friendly:** The front-end polling pauses automatically when
   visitors switch to another browser tab using the HTML5 Page Visibility API.
 * **Accessible & Responsive:** Fully responsive floating bar with reduced-motion
   support (`prefers-reduced-motion`) and subtle animated equalizer bars.
 * **Appearance Customizer & Live Preview:** Customize accent color, glass backdrop,
   opacity, border shape (pill, rounded, square), floating screen position, and 
   hover state effects with an interactive real-time preview in the admin panel.
 * **Spinning Vinyl Record Effect:** Option to display the album artwork as a spinning
   vinyl record with realistic groove borders during active playback, or as a classic
   static album sleeve.
 * **Clean Uninstallation:** Includes an `uninstall.php` handler to clean all stored
   options and transients from the database upon deletion.

### External services

This plugin connects to external services provided by Spotify to authenticate the
site owner and retrieve playback information:

 1. Spotify Accounts Service (https://accounts.spotify.com)

* Purpose: Handles the OAuth2 authorization code exchange and token refresh so the
plugin can securely communicate with Spotify on the site owner’s behalf without 
storing passwords.
 * Data sent and conditions: The site administrator’s Spotify
API client credentials (Client ID and Client Secret), authorization code, and refresh
token are transmitted server-to-server over HTTPS during initial setup and token
refreshes. No website visitor data is ever sent to this service. * Terms of service:
[Spotify Developer Terms](https://developer.spotify.com/terms) and [Spotify Terms of Use](https://www.spotify.com/legal/end-user-agreement/)*
Privacy policy: [Spotify Privacy Policy](https://www.spotify.com/legal/privacy-policy/)

 1. Spotify Web API (https://api.spotify.com/v1)

* Purpose: Fetches the site owner’s currently playing track (/v1/me/player/currently-
playing) or recently played track history (/v1/me/player/recently-played).
 * Data
sent and conditions: An OAuth2 Bearer Access Token is sent in the HTTP Authorization
header by your WordPress server when requesting listening activity. Requests are
cached server-side using WordPress Transients (30-second TTL by default) to minimize
calls. No user, visitor, or tracking data is ever collected or sent to Spotify. *
Terms of service: [Spotify Developer Terms](https://developer.spotify.com/terms)
and [Spotify Terms of Use](https://www.spotify.com/legal/end-user-agreement/) * 
Privacy policy: [Spotify Privacy Policy](https://www.spotify.com/legal/privacy-policy/)

## Screenshots

[⌊The floating glassmorphism widget displaying the currently playing song with spinning
vinyl album art, animated equalizer bars, and a Spotify play link.⌉⌊The floating
glassmorphism widget displaying the currently playing song with spinning vinyl album
art, animated equalizer bars, and a Spotify play link.⌉[

The floating glassmorphism widget displaying the currently playing song with spinning
vinyl album art, animated equalizer bars, and a Spotify play link.

[⌊The Spotify Connection settings tab showing the 3-step OAuth2 setup, connection
status, and the [npwfs_now_playing] shortcode.⌉⌊The Spotify Connection settings 
tab showing the 3-step OAuth2 setup, connection status, and the [npwfs_now_playing]
shortcode.⌉[

The Spotify Connection settings tab showing the 3-step OAuth2 setup, connection 
status, and the [npwfs_now_playing] shortcode.

[⌊The Appearance & Live Preview tab with real-time interactive customization for
colors, glass opacity, hover effects, album art style, border shape, and screen 
position.⌉⌊The Appearance & Live Preview tab with real-time interactive customization
for colors, glass opacity, hover effects, album art style, border shape, and screen
position.⌉[

The Appearance & Live Preview tab with real-time interactive customization for colors,
glass opacity, hover effects, album art style, border shape, and screen position.

## Installation

 1. Upload the plugin folder `now-playing-widget-for-spotify` to your `/wp-content/
    plugins/` directory, or install the `.zip` archive via **Plugins > Add New > Upload
    Plugin**.
 2. Activate the plugin through the **Plugins** screen in WordPress.
 3. Navigate to **Settings > Now Playing for Spotify** in your dashboard.
 4. Follow the **3-Step Setup**:
 5.  * Create a free developer application in the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard).
     * Copy the exact **Redirect URI** provided on the settings page and save it in
       your Spotify App settings.
     * Paste your **Client ID** and **Client Secret**, then click **Save credentials**.
     * Click the green **Connect with Spotify** button. Accept the prompt on Spotify’s
       authorization screen.
 6. Place the shortcode `[npwfs_now_playing]` anywhere on your site (posts, pages, 
    block themes, Elementor, or footer widget areas).

_(Note: The widget stays hidden until an account is connected and a track is found,
keeping your site layout clean)._

## FAQ

### Does this plugin track website visitors?

No. In strict compliance with WordPress.org Guidelines 7 & 9, this plugin does not
track website visitors, does not store tracking cookies, and does not send any visitor
data to Spotify or any third party. All external API requests are performed strictly
server-to-server between your WordPress host and Spotify to display the site owner’s
playback, which is then served sanitized to visitors via a local WordPress REST 
endpoint.

### Does this plugin slow down my site?

No. Assets (CSS/JS) are only enqueued when the shortcode is actually rendered on
the current page. Track data is cached via WordPress Transients, and front-end polling
is throttled and paused when the user switches tabs.

### Will my Spotify credentials be exposed to visitors?

Never. All requests to the Spotify Accounts API and Web API are executed by your
WordPress server in PHP. The browser only receives the public track metadata (song
name, artist, cover image URL, Spotify link).

### What happens when I pause my playback?

The plugin automatically detects the idle state and queries your recently played
history, displaying your last track with a “Last played” label.

### Can I customize the polling interval or cache duration?

Yes. You can use standard WordPress filters in your theme’s `functions.php`:
 * `
add_filter('npwfs_cache_ttl', function() { return 60; });` (server cache seconds)*`
add_filter('npwfs_poll_interval', function() { return 20; });` (frontend refresh
seconds)

### What happens when I deactivate or delete the plugin?

Deactivation preserves your credentials so you can reactivate without repeating 
setup. Deleting the plugin through WordPress triggers `uninstall.php`, which permanently
deletes all stored options and transients.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Now Playing Widget for Spotify” is open source software. The following people have
contributed to this plugin.

Contributors

 *   [ tuliocareli ](https://profiles.wordpress.org/tuliocareli/)

[Translate “Now Playing Widget for Spotify” into your language.](https://translate.wordpress.org/projects/wp-plugins/now-playing-widget-for-spotify)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/now-playing-widget-for-spotify/),
check out the [SVN repository](https://plugins.svn.wordpress.org/now-playing-widget-for-spotify/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/now-playing-widget-for-spotify/)
by [RSS](https://plugins.trac.wordpress.org/log/now-playing-widget-for-spotify/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.0

 * Major refactor adhering to WordPress.org Plugin Coding Standards and Review Guidelines.
 * Added Appearance & Live Preview customizer tab for colors, glass opacity, border
   shapes, screen positions, and hover effects.
 * Added Spinning Vinyl Record animation effect with realistic groove styling and
   classic cover toggle.
 * Documented external Spotify Accounts and Web API services in strict compliance
   with Guideline 6.
 * Structured modular codebase: separated options, Spotify API client, REST API 
   controller, shortcode and admin logic.
 * Added CSRF state parameter validation via `wp_create_nonce` during OAuth2 flow.
 * Upgraded shortcode to properly prefixed `[npwfs_now_playing]` with multi-instance
   DOM support.
 * Implemented access token transient caching to avoid redundant token grant requests
   on every poll.
 * Added Page Visibility API support to pause front-end polling on inactive browser
   tabs.
 * Added animated audio equalizer bars and `prefers-reduced-motion` accessibility
   support.
 * Added `uninstall.php` to completely clean up database options and transients 
   on deletion.
 * Added automatic migration from legacy 1.0.0 option names (`tsw_*`).

#### 1.0.0

 * Initial release.
 * 1-Click OAuth2 flow setup.
 * Fallback to recently played history.
 * Glassmorphism UI styling.

## Meta

 *  Version **1.1.0**
 *  Last updated **1 hour ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.8 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [glassmorphism](https://wordpress.org/plugins/tags/glassmorphism/)[music](https://wordpress.org/plugins/tags/music/)
   [now playing](https://wordpress.org/plugins/tags/now-playing/)[Spotify](https://wordpress.org/plugins/tags/spotify/)
   [widget](https://wordpress.org/plugins/tags/widget/)
 *  [Advanced View](https://wordpress.org/plugins/now-playing-widget-for-spotify/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/now-playing-widget-for-spotify/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/now-playing-widget-for-spotify/reviews/)

## Contributors

 *   [ tuliocareli ](https://profiles.wordpress.org/tuliocareli/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/now-playing-widget-for-spotify/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://tuliocareli.com/)