=== Always Visible Pin It Button for Pinterest ===
Contributors: muntaseerrahman
Donate link: https://muntaseerrahman.com
Tags: pinterest, pin it, images, social, sharing
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 1.1.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds an always-visible Pinterest Pin It button on images in your posts and pages — no hover required.

== Description ==

**Always Visible Pin It Button for Pinterest** makes it effortless for your visitors to save your images to Pinterest.

Unlike other Pinterest plugins that only show the Pin It button when a user hovers over an image, this plugin keeps the button **always visible**. This is especially important for mobile users — there is no hover on touch devices!

= Features =

* **Always visible** — The Pin It button is always shown, not just on hover
* **Mobile friendly** — Works perfectly on touch devices where hover doesn't exist
* **Smart image targeting** — Choose which images get the button based on orientation (horizontal, vertical, square) and minimum dimensions
* **Configurable button** — Official Pinterest style or custom icon, three sizes, rectangular or round shape
* **Flexible positioning** — Place the button in any corner of the image
* **Content-aware** — Only adds buttons to images inside your post and page content, never on logos, icons, or sidebar images
* **Lazy load support** — Works with standard and lazy-loaded images
* **Per-image control** — Exclude specific images using a CSS class
* **Live preview** — See how your button looks in the admin settings before saving
* **Lightweight** — No bloat, no external API calls, no tracking

= How It Works =

1. The plugin scans images inside your post and page content
2. It checks each image against your targeting rules (size, orientation)
3. Qualifying images get an always-visible Pin It button overlaid on them
4. When a visitor clicks the button, the Pinterest save dialog opens with the image, page URL, and description pre-filled

== Installation ==

1. Upload the `always-visible-pin-it-button-for-pinterest` folder to `/wp-content/plugins/`, or install directly through the WordPress Plugins screen.
2. Activate the plugin through the Plugins screen.
3. Go to Settings → Pin It Button to configure the button appearance, position, and targeting rules.

== Frequently Asked Questions ==

= Does this plugin work on mobile? =

Yes! That is the main advantage. Since the button is always visible, mobile and tablet users can pin your images without needing to hover.

= Will it slow down my site? =

No. The plugin is lightweight with minimal CSS and JavaScript. It makes no external API calls and loads assets only on single post and page views.

= Can I choose which images get the button? =

Yes. You can filter images by orientation (horizontal, vertical, square, or all), set minimum width and height thresholds, and exclude specific images by adding a CSS class.

= Does it work with lazy-loaded images? =

Yes. The plugin uses a MutationObserver to detect images that load after the initial page render.

= Can I exclude a specific image? =

Add the CSS class `no-pin-it` (or your custom class from settings) to any image you want to exclude. You can also use the standard `data-pin-nopin` attribute.

= What Pinterest description is used? =

You can choose between the image alt text, the post title, or a combination of both in the settings.

= Does it work with Gutenberg? =

Yes. It works with the standard WordPress block editor and classic editor content.

== Screenshots ==

1. Pin It button always visible on a blog post image
2. Settings page — General tab
3. Settings page — Appearance tab with live preview
4. Settings page — Targeting tab

== Changelog ==

= 1.1.2 =
* Fixed button rendering as a stretched bar inside themes that style descendant links (e.g. Kadence Post Grid). Critical CSS properties are now protected from theme overrides.
* Fixed buttons randomly missing on sites running Mediavine / other ad networks. Exclusion selectors were matching state classes on &lt;body&gt; and excluding every image.
* Avoided nested &lt;a&gt; when images are already wrapped in a link — Pin It is now inserted as a sibling of the existing link.

= 1.1.1 =
* Fixed phantom update notice that could reappear after a successful plugin update. The updater now compares versions properly and clears stale update transients on upgrade.

= 1.1.0 =
* Added one-click auto-updates via the plugin's own update server — no Git or manual ZIP upload required.
* Added plugin icons for the WordPress Updates screen.

= 1.0.0 =
* Initial release
* Always-visible Pin It button on post and page images
* Configurable button style, size, shape, and position
* Image targeting by orientation and minimum dimensions
* Lazy-loaded image support
* Live preview in admin settings
* Per-image exclusion via CSS class

== Upgrade Notice ==

= 1.0.0 =
Initial release.
