WP Manifestindependent plugin directory
manifest / social / fc-autoposter

FC Autoposter

A WordPress plugin with Vue and Vite admin panel

by Rahat · github.com/rahat1994/fc-autoposter · 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/rahat1994/fc-autoposter/archive/refs/heads/main.zip

A WordPress plugin with Vue 3 and Vite admin panel.

Features

  • WordPress plugin with admin panel
  • Vue 3 for reactive UI components
  • Vite for fast development and optimized builds
  • Hot Module Replacement (HMR) in development mode
  • Laravel-style PHP routing system for building REST APIs
  • MVC architecture with Controllers and Middleware
  • Built-in authentication and authorization
  • Input validation helpers

Installation

  1. Clone or download this repository into your WordPress plugins directory:

    cd wp-content/plugins/
    git clone https://github.com/rahat1994/fc-autoposter.git
  2. Install PHP dependencies with Composer:

    cd fc-autoposter
    composer install --no-dev
  3. Install Node.js dependencies:

    cd admin
    npm install
  4. Build the admin panel:

    npm run build
  5. Activate the plugin in WordPress admin panel (Plugins > Installed Plugins > FC Autoposter > Activate)

Development

To develop with hot module replacement:

  1. Enable WordPress debug mode in wp-config.php:

    define('WP_DEBUG', true);
  2. (Optional) Configure custom dev server URL in wp-config.php:

    define('FC_AUTOPOSTER_DEV_SERVER', 'http://localhost:5173');
  3. Start the Vite dev server:

    cd admin
    npm run dev
  4. The admin panel will automatically load from the dev server at http://localhost:5173

  5. Make changes to Vue components in admin/src/ and see them reflected instantly

Note: Development mode only works when WP_DEBUG is enabled for security reasons.

Production Build

To create a production build:

cd admin
npm run build

This will create optimized files in the admin/dist/ directory.

Plugin Structure

fc-autoposter/
├── fc-autoposter.php       # Main plugin file
├── composer.json           # PHP dependency management
├── vendor/                 # Composer dependencies (auto-generated)
├── admin/                  # Admin panel Vue app
│   ├── src/
│   │   ├── main.js        # Vue app entry point
│   │   └── App.vue        # Main Vue component
│   ├── dist/              # Production build output (generated)
│   ├── package.json       # Node dependencies
│   └── vite.config.js     # Vite configuration
├── app/                    # PHP backend classes (renamed from includes/)
│   ├── Routing/           # Routing system
│   ├── Controllers/       # API controllers
│   └── Middleware/        # Request middleware
├── routes/
│   └── api.php            # API route definitions
├── README.md
└── ROUTING.md             # Routing system documentation

Usage

After activating the plugin, you'll find "FC Autoposter" in the WordPress admin menu. Click it to access the admin panel powered by Vue 3.

API Development

The plugin includes a Laravel-style routing system for building REST APIs. See ROUTING.md for complete documentation.

Quick example:

// In routes/api.php
$router->get('/hello', function($request) {
    return Response::success('Hello from API!');
});

// Access at: http://your-site.com/wp-json/fc-autoposter/v1/hello

For more details, see the complete routing documentation.

Requirements

  • WordPress 5.0 or higher
  • PHP 7.4 or higher
  • Node.js 18 or higher
  • npm or yarn

License

GPL v2 or later