WP Manifestindependent plugin directory
manifest / media / spgallery

SP Gallery

A flexible gallery plugin for showcasing products and portfolios with tabs, sliders, and lightbox.

by Kyrylo Sanchenko · github.com/sanchenkowork/spgallery · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/sanchenkowork/spgallery/archive/refs/heads/main.zip

A WordPress plugin for showcasing products and portfolio projects as interactive galleries with tabs, sliders, and lightbox.

Demo

Live Demo: https://mebzone.com.ua/en/home/


Features

  • Two custom post types — Products (spg_catalog) and Projects (spg_project)
  • Hierarchical taxonomies — separate category trees for products and projects
  • Tab navigation — dynamic subcategory filtering on product archive pages
  • Swiper.js sliders — touch-enabled project gallery sliders with prev/next controls
  • Lightbox viewer — full-size image preview via Lightbox2 (can be disabled)
  • Admin dashboard — stats overview with quick links to add/view content
  • Gallery metabox — drag-and-select image gallery manager on project edit screens
  • Conditional asset loading — lightbox scripts only load when the feature is enabled
  • Fully translatable — all strings use WordPress i18n functions (text domain: spgallery)
  • Secure — nonce verification, capability checks, input sanitization, output escaping throughout

Requirements

Requirement Version
WordPress 5.8 or higher
PHP 7.4 or higher
MySQL 5.6 or higher

Installation

  1. Clone or download the repository into your plugins directory:
    git clone https://github.com/kyrylsanchenko/sp-gallery.git wp-content/plugins/spgallery
  2. Activate the plugin from Plugins → Installed Plugins in the WordPress admin.
  3. Rewrite rules are flushed automatically on activation — no need to visit Permalinks settings.
  4. Navigate to SP Gallery in the admin sidebar to manage content.

Usage

Products (Catalog)

Products are displayed automatically on their taxonomy archive pages — no shortcode needed.

  1. Go to SP Gallery → SPG Products → Add New
  2. Set a featured image or upload images via the gallery metabox
  3. Assign the product to a category
  4. Publish — it appears automatically on the category archive page with tab navigation

Projects (Portfolio)

Projects are displayed via a shortcode or automatically on taxonomy archive pages.

  1. Go to SP Gallery → SPG Projects → Add New
  2. Upload images via the Project Gallery metabox
  3. Assign the project to a category
  4. Publish — use the shortcode below to embed the portfolio anywhere

Shortcode: [portfolio_gallery]

[portfolio_gallery]

Displays all published projects grouped by category.

[portfolio_gallery category="web-design"]

Filters output to a single category by slug. Accepts a comma-separated list of slugs.

[portfolio_gallery limit="12"]

Limits the total number of projects queried.

[portfolio_gallery posts_per_category="3"]

Limits how many projects appear per category group.

[portfolio_gallery show_category_link="false"]

Hides the "More projects" link below each category block.

All attributes combined:

[portfolio_gallery category="web-design,branding" limit="20" posts_per_category="4" show_category_link="true"]

Settings

Go to SP Gallery → Dashboard in the WordPress admin.

Option Description
Enable Lightbox Enables full-size image preview when clicking gallery images. When disabled, lightbox assets are not loaded.

Project Structure

spgallery/
├── assets/
│   ├── css/
│   │   ├── admin/          # Admin dashboard styles
│   │   └── frontend/       # Frontend gallery styles (SCSS + compiled CSS)
│   ├── js/
│   │   ├── spg-admin.js    # Media library integration for gallery metabox
│   │   └── spg-main.js     # Frontend tabs, Swiper sliders, lightbox init
│   └── vendors/
│       ├── lightbox2/      # Lightbox2 library
│       └── swiper/         # Swiper.js library
├── includes/
│   ├── admin/              # Settings page, gallery metabox
│   ├── catalog/            # Product renderer, catalog security
│   ├── core/               # Plugin bootstrap, asset manager, template loader
│   ├── cpt/                # Custom post type and taxonomy registration
│   └── projects/           # Portfolio renderer, shortcode handler
├── languages/              # Translation files (.po / .mo)
├── templates/
│   ├── product/            # Archive template for product categories
│   └── project/            # Archive template for project categories
├── uninstall.php           # Cleanup on plugin deletion
└── spgallery.php           # Plugin entry point

Localization

All user-facing strings are translatable. Translation files (.po / .mo) live in /languages.

To contribute a translation:

  1. Open /languages/spgallery.pot in Poedit or Loco Translate
  2. Translate strings and export .po + .mo files
  3. Name the files using the locale code, e.g. spgallery-de_DE.po

Currently included: English (default), Ukrainian (uk_UA), Russian (ru_RU)


Security

  • All form submissions verified with WordPress nonces
  • All user input sanitized (sanitize_text_field, absint, wp_unslash)
  • All output escaped (esc_html, esc_attr, esc_url, wp_kses_post)
  • Capability checks on every admin action (manage_options, edit_post)
  • Attachment IDs validated with wp_attachment_is_image() before saving
  • Plugin data fully removed on uninstall via uninstall.php

License

MIT — free to use, modify, and distribute.


Author

Kyrylo Sanchenko sanchenko.top