=== Music Meta by Mozbeats ===
Contributors: mozbeats
Tags: music metadata, artists, seo, auto tags, shortcode
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generates artist biographies, smart music metadata sheets, text templates, and automatic tags for WordPress music websites.

== Description ==

Music Meta by Mozbeats is an advanced plugin for music websites built with WordPress. It analyzes the post title, identifies the main artist, featured artists, year, music genre, and release type, and automatically generates a professional Music Metadata Sheet.

Version 1.5.1 adds Spotify and Deezer album imports, automatic generated track posts, refreshed Premium playlist controls, improved artist detection, and the latest Music Meta by Mozbeats dashboard refinements.

== Main Features ==

Smart Artist Detection

* Automatically detects the main artist.
* Supports multiple artists in the same title.
* Identifies featured artists using feat. and ft.
* Corrects grammar in automatically generated text.
* Updates tags when the post title is changed.

Tag System

* Creates tags for the main artist, featured artists, and year.
* Preserves manually added tags.
* Removes old automatically generated tags.
* Allows you to choose whether artists and genres come from tags or categories.

Music Metadata Sheet

* Main shortcode: [mozbeats_ficha_tecnica]
* `$ficha_tecnica` variable for using the Music Metadata Sheet anywhere in the post template.
* Extra fields for quality, file size, duration, production, and rating.
* Professional Premium layouts for music websites.

Secure Download Button

* Download link field for each post.
* Ability to add links by pressing Enter before publishing.
* Download counter.
* Google Drive shared links are converted when possible.
* Multiple download links in the Premium version.

Premium Playlists

* Automatic playlist creation for main Album, EP, and Mixtape posts.
* Playlist mode: automatic, main post, numbered track, or disabled.
* Album, EP, and Mixtape posts can be treated as main posts without numbering.
* Tracks point to the main post and are ordered by track number.
* `$playlist_premium` variable for inserting the playlist into the post template.

More Options +Premium

The Premium version costs $25, and each WordPress user must activate their own license key.

Premium Features:

* Five download button styles.
* Custom download button text.
* Alternative download links.
* JSON backup export.
* Import previously downloaded backups.
* Four professional layouts for the Music Metadata Sheet: Clean Editorial, Studio Cards, Release Table, and Featured Premium Panel.
* Premium Playlist for Album, EP, and Mixtape.
* Premium protection against copying content generated by templates.
* Automatic insertion of the Music Metadata Sheet into posts without manually adding the shortcode.
* Individual option in each post to disable the automatic shortcode.
* Automatic email sent to the buyer with the Premium key.
* API integration to generate keys after purchases through the portfolio.

License Key Management

* License key management has been removed from the main plugin.
* Key creation, blocking, and delivery are handled exclusively by the Mozbeats License Manager mini plugin.
* API key creation requires a secret token from the mini plugin.
* Client websites only activate the received key in the main plugin.
* The automatic email is sent from noreplay@mozbeats.co.mz and includes WhatsApp support: +258849224258.

Premium Portfolio

This version includes a portfolio page at:

* `index.html`
* `portfolio.html`
* `portfolio-premium.zip`

The `index.html` file allows the subdomain to open the portfolio directly without requiring `/portfolio.html`. For the background to load correctly, also upload the `screenshot-1.png` file to the same folder as `index.html`, or extract the `portfolio-premium.zip` package directly into the subdomain root.

== Template Variables ==

* `$descricao_padrao`
* `$titulo_musica`
* `$artistas`
* `$frase_artistas`
* `$participacoes`
* `$frase_participacao`
* `$tipo_lancamento`
* `$frase_tipo_lancamento`
* `$genero`
* `$ano`
* `$categoria`
* `$titulo_completo`
* `$ficha_tecnica`
* `$botao_download`
* `$link_download`
* `$formato_ficheiro`
* `$data_publicacao`
* `$url_post`
* `$playlist_premium`

== Shortcodes ==

* [mozbeats_ficha_tecnica]
* [mozbeats_ft]
* [mozbeats_biografia]
* [mozbeats_biografias]

== Installation ==

1. Upload the plugin to `/wp-content/plugins/`.
2. Activate it from the WordPress dashboard.
3. Configure it from the Music Meta by Mozbeats menu.
4. Use the shortcodes or variables in your post templates.
5. To open the Premium portfolio on a subdomain, point the subdomain to the folder containing `index.html`.

== Changelog ==

= 1.5.1 =
* Prevented Spotify track posts from being duplicated when the album/EP post is updated.
* Created Spotify track posts now store an internal Spotify track key and parent album ID for reliable future matching.
* Created Spotify track posts keep the default WordPress category and default post format.
* When post type source is configured as categories, Album/EP/Mixtape now replace the default category instead of being added beside it; Music keeps the default WordPress category.
* Spotify cover import now handles image URLs without file extensions and applies the cover to the album and generated track posts.
* Created Spotify track posts now fill the Yoast SEO focus keyphrase with the generated post title.
* Spotify playlist titles now keep all album artists as main artists and only move extra track artists into feat.
* Duplicate feat names are removed when Spotify repeats an artist in the title and in the artist list.
* Created Spotify track posts now use the album/EP post URL as the download link instead of copying the album download file URL.
* Created Spotify track posts inherit valid music genres from the album/EP post even when genres are mixed between tags and categories.
* Created Spotify track posts now use 320Kbps as the default quality.
* Spotify cover imports now run in the background to prevent album saves from timing out with server error 500.
* Album/EP updates now reuse cached Spotify tracks when the album link has not changed.
* Added Premium admin toggles for Spotify cover import, applying album covers to generated tracks, inheriting album genres, and default 320Kbps quality.
* Improved Spotify playlist and generated post featured artist formatting so two names use "&" and three or more names use commas with "&" only before the last artist.
* Spotify playlist and generated posts now preserve the main artist text exactly as written in the album/EP post title.
* Generated Spotify track posts now always use the parent album/EP post URL as the download link, including previously generated tracks.
* Generated Spotify track posts can now use individual download links when edited manually.
* Artist auto-tagging now preserves valid music genres when artists and genres share the same taxonomy.
* Spotify import errors now include the API response detail when available.
* Added an optional Premium toggle for importing artist genres from Spotify to reduce Too Many Requests errors by default.
* Spotify rate limit responses now keep the existing imported track cache instead of clearing the playlist.
* Added Deezer album/EP links as an alternative source for importing playlist tracks, durations, cover images, and generated posts with the same Premium rules.
* Corrected Deezer participant detection using artists, contributors, and featured_artists.
* Refreshes old Deezer track caches so playlists created during testing can rebuild with featured artists.
* Applies the generated-track rules equally to Spotify and Deezer, including Music type, track playlist role, Yoast focus keyphrase, inherited genres, featured artists, and album artwork.
* Added a playlist source selector box so each album/EP uses only one automatic source: none, Spotify, or Deezer.
* Improved Artists tab pagination alignment and visual style.

= 1.5 =
* Separated the post type taxonomy from the music genre taxonomy.
* Posts automatically created from Spotify now apply Music/Album/EP/Mixtape to the configured post type taxonomy.
* When an Album/EP Spotify link is added, the plugin imports the cover and sets it as the featured image when the post does not already have an image.
* Music genres imported from Spotify are filtered to prevent years, Album, EP, Music, and other non-musical terms from being added.
* The Artists tab now ignores years, genres, post types, and terms associated only with posts without musical indicators.
* Added a Premium option to automatically create posts from Spotify tracks without an internal post.
* Created posts receive the Music type, track number, duration, artists, genres inherited from the Album/EP, featured image, and download link from the main post.
* The release type selected in the post now creates or selects the corresponding term in the configured taxonomy.
* Improved the Artists tab filter to hide genres and release types.
* Internal posts linked to the playlist now display the title exactly as published.
* Removed "(Download)" text from internal playlist items.
* Spotify-imported tracks now appear in the format Artist - Title (feat. Featured Artist).
* Tracks linked to internal posts retain the link to the published post.
* The playlist now displays clean titles when a Spotify track points to an existing post.
* Artists are separated from the title, and multiple artists are joined with &.
* Featured artists detected in posts now appear after the title as "feat.".
* Fixed a fatal error when attempting to link Spotify tracks to existing posts.
* Simplified detection by combining the first Spotify artist with the track title in the published post title.
* Improved automatic linking of Spotify tracks to already published posts with full titles such as Artist - Song.
* Imported tracks no longer appear as separate items when a corresponding post exists on the website.
* Added Spotify integration to import tracks and durations from Albums and EPs into the playlist's main post.
* Premium Playlist can now combine tracks published on the website with tracks imported from Spotify.
* Tracks already published on the website have priority to prevent playlist duplication.
* Fixed the automatic shortcode so it does not duplicate when the post already contains a shortcode or Music Metadata Sheet template.
* Removed the date restriction to maintain compatibility with valid older music publications.
* The automatic template now requires a music category, preventing it from appearing on posts about other subjects.
* Fixed detection of music posts in the automatic shortcode when genres appear in tags or categories different from the main configuration.
* Added an individual post option to manually enable the automatic Music Metadata Sheet for older songs.
* Maintained protection against automatic application to old posts or content without musical indicators.
* Added Premium options to customize primary color, accent color, and dark color.
* Custom colors now affect download buttons, Music Metadata Sheet, release layouts, and Premium Playlist.
* Fixed the automatic shortcode so it only appears on posts created after the option is activated.
* Added checks to prevent automatic Music Metadata Sheets on old posts or content without musical indicators.
* Updated translations for the new Premium color section.
* Improved the plugin dashboard with a visual header, modern navigation, and statistics cards.
* Styled the settings, Premium, templates, artists, tables, and button sections.
* Added interactive states for buttons, genre lists, and download links.
* Improved the responsive experience of the WordPress admin panel.
* Updated translations for the new interface.
* Fixed tracklist detection to maintain compatibility with tracks using the main Album, EP, or Mixtape post link.
* Playlist-by-code mode now also finds older tracks associated through the main post link.
* Normalized release type detection across new metadata, old categories/tags, and old links.
* Track numbering is now automatically filled with the next available number when the post has a playlist/code but no track number.
* Playlist sorting is now smarter: it uses the track number when available and the post date as a fallback.
* Updated translation strings for the new version.

= 1.4.7 =
* Added Premium layouts for release cover, title, and description: Editorial Music, Studio Cover, and Dark Premium.
* Added a Premium option to choose between playlist by main post link or by unique code.
* Added a playlist code field to posts when code mode is active.
* Maintained compatibility with manual descriptions and the existing classic mode.

= 1.4.6 =
* Fixed title and featured artist extraction in the Music Metadata Sheet for titles containing feat., ft., and dashes.
* Adjusted copy protection to apply only to Music Metadata Sheet and Premium Playlist templates while keeping the download button functional.
* Removed the Admin menu from the main plugin so license management remains exclusively in the Mozbeats License Manager mini plugin.
* The REST endpoint with a token for creating keys after portfolio purchases is now available only in the mini plugin.
* Added an automatic email containing the Premium key and WhatsApp support: +258849224258.

= 1.4.5 =
* Added Premium mode with a $25 price and per-user key activation.
* Added the "More Options +Premium" section to the dashboard.
* Added five download button styles and custom button text.
* Improved the download metabox to allow adding links with Enter before publishing.
* Added support for multiple saved download links.
* Added JSON backup export and import for settings, links, and post data connected to shortcodes.
* Added the `$ficha_tecnica` variable to position the Music Metadata Sheet anywhere in the post template.
* Added the `$botao_download`, `$link_download`, `$formato_ficheiro`, `$data_publicacao`, `$url_post`, and `$playlist_premium` variables.
* Created Premium portfolio in `index.html` and `portfolio.html`.
* Added professional Premium layouts for the Music Metadata Sheet.
* Added Premium Playlist for Album, EP, and Mixtape.
* Added playlist mode to define automatic, main post, numbered track, or disabled.
* Album, EP, and Mixtape posts can now be main posts without numbering.
* Added a Premium option to protect templates against front-end copying.
* Added an option to automatically insert the Music Metadata Sheet into posts.
* Added per-post control to disable the automatic shortcode.
* Moved the "More Options +Premium" section to its own tab before "How to Use".
* Fixed the Premium tab to display only Premium options.
* Improved automatic shortcode detection to prevent duplication when the post already contains a Music Metadata Sheet shortcode.

= 1.4.4 =
* Updated the declared compatibility with WordPress 7.0.1.

= 1.4.3 =
* Bug fixes.

= 1.4.2 =
* Improved secure download button rules for Albums, EPs, and Mixtapes.
* Google Drive links are converted to direct downloads only on music posts.
* File size is displayed only for music posts or files uploaded to WordPress.
* Added a rich editor for custom text templates.
* Fixed conversion of biography shortcodes to permanent HTML.
* Bulk conversion now processes posts in small batches to prevent server errors.
