=== Section Blocks – The Layout Builder for Gutenberg ===
Contributors:      nazmul111
Tags:              gutenberg, blocks, hero, pricing, faq
Requires at least: 6.3
Tested up to:      7.1
Requires PHP:      7.4
Stable tag:        1.2.4
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

A comprehensive WordPress Gutenberg plugin with 12 professional section blocks for building modern websites.

== Description ==

Section Blocks is a powerful WordPress Gutenberg plugin that provides a complete collection of professional section blocks for building modern, responsive websites. Each block is carefully crafted with beautiful design, extensive customization options, and mobile-first responsive design.

**Key Features:**

* 12 professional section blocks
* Custom "Section Blocks" category in the Gutenberg editor
* Mobile-first responsive design
* Extensive color, typography, and spacing customization
* Hover effects and scroll-triggered animations
* SEO-friendly semantic HTML markup
* Accessibility-compliant ARIA labels and keyboard navigation
* Works with any properly coded WordPress theme

**Available Blocks:**

**Hero Section** — Eye-catching hero sections with background images, customizable headings, subtitles, and call-to-action buttons. Includes overlay controls and multiple text alignment options.

**Features Section** — Showcase product or service features in a 3–6 column responsive grid. Includes 16+ built-in WordPress Dashicons and optional side images.

**Services Section** — Display services with stylish cards. Choose from 60+ Dashicons or upload custom images. Supports 2–4 column layouts, hover effects, and CTA buttons.

**Steps Timeline** — Display multi-step processes with vertical, horizontal, and zigzag layouts. Supports 3–6 configurable steps, visual connectors, and scroll-triggered animations.

**Video CTA Section** — Engaging video call-to-action sections. Supports YouTube, Vimeo, and self-hosted videos with overlay controls and conversion-focused design.

**Testimonials Section** — Showcase customer testimonials with star ratings, client images, and names. Supports both carousel (with pause-on-hover) and grid layout options.

**Pricing Tables** — Create professional pricing comparison tables with multiple plans, feature lists, billing period toggle, and highlighted recommended plans.

**Team Members** — Showcase your team with Card, Overlay, Minimal, and Professional layout styles. Includes social media links and hover effects.

**FAQ / Accordion** — Toggle-style accordion sections with smooth animations and built-in schema markup for SEO benefits.

**Gallery Portfolio** — Display images in masonry or grid layouts with filterable categories and lightbox functionality.

**Newsletter Signup** — Email capture forms with Mailchimp integration, WordPress native storage, privacy consent support, and honeypot spam protection. Configure under Settings > Newsletter Settings.

**Call to Action** — High-converting CTA sections with solid, gradient, or image backgrounds, customizable text, and multiple button options.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/section-blocks`, or install directly through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. In the Gutenberg editor, look for the "Section Blocks" category to find all available blocks.
4. For newsletter features, configure settings under **Settings > Newsletter Settings**.

== Frequently Asked Questions ==

= How many blocks are included? =

The plugin includes 12 professional section blocks: Hero Section, Features Section, Services Section, Steps Timeline, Video CTA Section, Testimonials, Pricing Tables, Team Members, FAQ/Accordion, Gallery Portfolio, Newsletter Signup, and Call to Action.

= How do I configure newsletter integrations? =

Go to **Settings > Newsletter Settings** in your WordPress admin to configure your Mailchimp API key, custom API endpoint, reCAPTCHA settings, and view the subscriber list.

= Are the blocks responsive? =

Yes. All blocks are built mobile-first and automatically adapt to different screen sizes.

= Can I customize colors and typography? =

Yes. Every block has extensive customization options for colors, typography, spacing, and layout in the Gutenberg editor sidebar.

= Do the blocks work with any WordPress theme? =

Yes. The blocks are designed to work with any properly coded WordPress theme that supports the block editor.

= Is the plugin accessible? =

Yes. All blocks include proper ARIA labels, semantic HTML markup, and follow WordPress accessibility guidelines.

= Does the Newsletter block store subscriber data? =

When using the default WordPress storage option, email addresses are stored in your WordPress database. You can view and manage them under Settings > Newsletter Settings. An uninstall routine removes this data when the plugin is deleted.

= Can I use Mailchimp for newsletters? =

Yes. Enter your Mailchimp API key and list ID under Settings > Newsletter Settings, then select "Mailchimp" as the integration type in the Newsletter Signup block settings.

== Screenshots ==

1. All 12 blocks displayed together showing the variety of section types available.
2. Newsletter signup block with subscription form, privacy consent, and success state.
3. Pricing Tables block with three-column layout, billing toggle, and recommended plan badge.
4. Team Members block showing the Card layout with social media links.
5. FAQ Accordion block with schema markup and smooth animations.
6. Hero Section block with background image, overlay, and CTA buttons.

== Changelog ==

= 1.2.4 =
* Security: Added direct-access (ABSPATH) guards to all block render templates.
* Security: Removed custom API endpoint exposure from the newsletter front-end markup; the admin-configured endpoint remains the only source used server-side.
* Security: Added capability check to the newsletter settings save handler.
* Security: Added rate limiting (5 submissions per IP per hour) to the public newsletter signup endpoint.
* Hardening: All AJAX input is now sanitized and unslashed consistently.
* Tested up to WordPress 7.1.

= 1.2.3 =
* Security: Added CSRF nonce verification to the Newsletter Settings admin form.
* Security: Removed server-side use of client-supplied API endpoint (SSRF prevention); endpoint is now configured in admin settings only.
* Security: Fixed XSS vulnerability in Gallery Portfolio image attribute builder.
* Security: Fixed onclick injection vulnerability in Video CTA Section scroll buttons; replaced with safe data-attribute approach.
* Security: Added validation for base64 data URL images in Team Members block.
* Bug fix: Removed inline `<script>` tags from Pricing Tables, Testimonials, CTA Section, and Video CTA renders — scripts are now properly enqueued via view.js files.
* Bug fix: Removed leftover debug HTML comments from Pricing Tables render.
* Bug fix: Fixed fatal error on double-render — helper functions in Video CTA and CTA Section renders now use function_exists() guards.
* Bug fix: Fixed team member image upload in editor — now correctly saves {url, alt, id} object instead of raw media library object.
* Bug fix: Fixed masonry gallery layout breaking on repeated filter/sort calls — positions now reset before each recalculation.
* Bug fix: Fixed IntersectionObserver memory leak in Gallery Portfolio infinite scroll — observer now disconnects when all items are loaded.
* Bug fix: Fixed ResizeObserver memory leak in Video CTA Section.
* Bug fix: Fixed reCAPTCHA silent failure in Newsletter Signup — submission is now blocked if reCAPTCHA is required but unavailable.
* Bug fix: Fixed CTA Section buttons — empty URL now renders a semantic `<button>` element instead of `<a onclick="return false">`.
* Bug fix: Fixed Pricing Tables — all plans now render regardless of column count (no silent plan truncation).
* Improvement: Added plugin activation hook to create the newsletter subscribers database table on install.
* Improvement: Added uninstall routine to remove all plugin data (options and database table) on deletion.
* Improvement: Added "Settings" action link on the Plugins list page.
* Improvement: Testimonials carousel now pauses on hover and supports keyboard arrow navigation.
* Improvement: Added native loading="lazy" to Team Members images.
* Improvement: Social icon aria-labels now use natural language ("Visit [Name]'s LinkedIn profile").
* Improvement: Video caption tracks now use the WordPress site locale instead of hardcoded English.
* Improvement: Custom API endpoint moved to admin settings for security.

= 1.2.2 =
* Added analytics integration with Appsero for plugin usage insights.
* Updated minimum PHP requirement to 7.4.
* Improved plugin architecture for better maintainability.

= 1.2.1 =
* Added Services Section block with service cards and CTA buttons.
* Added Steps Timeline block with vertical, horizontal, and zigzag orientations.
* Added Video CTA Section block with YouTube, Vimeo, and self-hosted video support.
* Enhanced testimonials with autoplay and animation effects.
* Improved responsive design across all blocks.

= 1.2.0 =
* Added cover image and logo to plugin assets.

= 1.1.0 =
* Added Newsletter Signup block with Mailchimp integration and WordPress native storage.
* Added Gallery Portfolio block with masonry/grid layouts and lightbox.
* Added FAQ/Accordion block with schema markup.
* Added Team Members block with four layout styles and social media links.
* Added Hero Section block with background image and overlay controls.
* Added Features Section block with responsive grid and Dashicons.
* Added Testimonials Section block with star ratings.
* Added Pricing Tables block with feature comparison.
* Added Call to Action block.
* Created custom "Section Blocks" category in the Gutenberg editor.

= 0.1.0 =
* Initial release — plugin scaffolding and basic structure.
