user images and login
is a WordPress plugin that provides a custom private page template with integrated user authentication and photobooth image gallery management. This plugin allows authenticated users to view their personal photobooth images organized by categories (crown, hairline, left, right, top).
by sikandar · github.com/sikandar-app/user-images-and-login-plugin
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/sikandar-app/user-images-and-login-plugin/archive/refs/heads/main.zipProject Overview
User Images and Login is a WordPress plugin that provides a custom private page template with integrated user authentication and photobooth image gallery management. This plugin allows authenticated users to view their personal photobooth images organized by categories (crown, hairline, left, right, top).
Key Features
- Custom page template system compatible with WordPress 4.6 and above
- Secure user login/authentication
- Private user-only content pages
- Photobooth image gallery management
- Image organization by angle/category
- Responsive Bootstrap UI
- Remember me functionality for user credentials
- Session management
Installation
Prerequisites
- WordPress 4.6 or higher
- PHP support for file system operations
- Write permissions to WordPress uploads directory
Steps
-
Download the Plugin
- Clone or download this repository to your local machine
-
Upload to WordPress
- Connect via FTP or use WordPress file manager
- Navigate to
/wp-content/plugins/ - Upload the entire
user-images-and-loginfolder
-
Activate the Plugin
- Go to WordPress Admin Dashboard
- Navigate to Plugins
- Find User Images and Login
- Click Activate
-
Create a Private Page
- Go to Pages → Add New
- Assign the Private Page Template from the page template dropdown
- Configure your page settings
- Publish the page
-
Verify Installation
- The private page should now use the custom template
- Users can log in through the login form
- Authenticated users will see their photobooth images
Backend Architecture
Plugin Structure
user-images-and-login/
├── user-images-and-login.php # Main plugin file
└── template/
├── private-page-template.php # Custom page template
└── assets/
└── css/
├── bootstrap.min.css # Bootstrap framework
└── style.css # Custom styling
Core Components
1. Main Plugin File (user-images-and-login.php)
- PageTemplater Class: Manages custom page template registration
- Key Functions:
get_instance(): Singleton pattern for plugin instanceadd_new_template(): Registers template with WordPress 4.7+register_project_templates(): Adds template to WordPress cacheview_project_template(): Routes pages to custom template
2. Private Page Template (template/private-page-template.php)
-
User Authentication:
- Login form with email and password fields
- Remember me checkbox functionality
- Session and cookie management
- WordPress
wp_signon()for secure authentication
-
Image Gallery Management:
- Retrieves user images from
/wp-content/uploads/photobooth/{user_id}/{category}/ - Supported categories: crown, hairline, left, right, top
- Uses
glob()to fetch image files - Responsive grid layout using Bootstrap (col-2 columns)
- Retrieves user images from
3. Styling (template/assets/css/)
- bootstrap.min.css: Responsive framework
- style.css: Custom color and layout styles
Backend Workflow
-
Plugin Initialization
- Hooks into
plugins_loadedaction - Registers template with WordPress
- Caches template metadata
- Hooks into
-
Page Request
- Checks if page uses custom template
- Loads
private-page-template.php - Verifies user login status
-
User Login Process
- Receives POST request with email and password
- Authenticates via
wp_signon()function - Handles error messages
- Creates session and optional cookie
-
Image Retrieval
- Gets active user ID from session
- Scans photobooth directory structure
- Organizes images by category
- Renders images in responsive grid
Database & File Structure
Image Storage Pattern:
/wp-content/uploads/photobooth/
└── {user_id}/
├── crown/
│ ├── image1.jpg
│ └── image2.jpg
├── hairline/
├── left/
├── right/
└── top/
Security Features
- WordPress user authentication via
wp_signon() - Server-side session management
- File existence validation before rendering
- Error suppression for failed login attempts
Usage
For Site Administrators
- Create a new page and select "Private Page Template"
- Configure page title and settings
- Publish the page
- Share the page URL with authorized users
For End Users
- Navigate to the private page
- Enter WordPress user email and password
- Optionally check "Remember Me" to store credentials
- View personal photobooth images organized by category
File Permissions
Ensure the following directories have write permissions:
/wp-content/uploads/photobooth/- For image storage
Troubleshooting
| Issue | Solution |
|---|---|
| Template not appearing | Ensure WordPress version is 4.6+ |
| Images not displaying | Verify photobooth folder structure and image uploads |
| Login not working | Check WordPress user database and credentials |
| CSS not loading | Verify plugin is properly activated |
Support & Contributions
For issues, feature requests, or contributions, please contact the developer.
Author: Sikandar Abbas
Version: 1.0.0
Future Enhancements
Potential improvements for future versions:
- Admin dashboard for image management
- Image upload functionality
- Multiple photo angle combinations
- Email notifications
- Analytics and reporting
- Advanced user permissions