WordPress plugin repository system
The file outlines a full-featured public WordPress plugin repository system. It enables functionalities such as frontend display, plugin rating, filtering, category organization, pagination, and options for both paid and free plugins.
Here's a breakdown of what the plugin does:
-
Database Management:
- Upon activation, it creates or updates a custom database table (
wp_plugin_repo) to store plugin information like name, version, description, file URL, preview image, tags, category, rating, rating count, upload details, whether it's paid, and its sale URL.
- Upon activation, it creates or updates a custom database table (
-
Admin Area Features:
- Admin Menu: Adds "Plugin Repository" and "Plugin Settings" menu items under the WordPress admin panel.
- Plugin Upload: Provides an interface in the admin area to upload new plugins. This includes fields for:
- Plugin Name, Version, Description, Tags (comma-separated), Category.
- Option to mark a plugin as "Paid," which then requires a "Sale URL."
- For "Free" plugins, a ZIP file upload is required, and the plugin validates the ZIP to ensure it contains PHP files.
- An option to upload a preview image for the plugin.
- Plugin Listing and Management: Displays a list of all uploaded plugins in the admin area, showing their details, whether they are paid or free, their current rating, and actions to download/buy or delete them.
- Settings Page: Allows administrators to adjust settings for individual plugins, specifically toggling their "Paid" status and setting the "Sale URL." It also includes a mechanism to fix potential database schema issues.
-
Frontend Display (via Shortcode):
- Provides a
[plugin_repo]shortcode that can be used on any WordPress page or post to display the plugin repository to site visitors. - Filtering and Sorting: On the frontend, users can filter plugins by tags and categories, and sort them by name, version, or rating (ascending/descending).
- Pagination: Implements pagination for Browse a large number of plugins.
- Rating System: Allows users to rate plugins from 1 to 5 stars. This rating contributes to the overall average rating and count for each plugin.
- Download/Buy Links: Depending on whether a plugin is marked as free or paid, it will display a "Download" button (linking to the uploaded ZIP file) or a "Buy This Plugin" button (linking to the specified sale URL).
- Preview Images: Displays a preview image for each plugin if one was uploaded.



Comentarii
Trimiteți un comentariu