Vendor Management

Vendor Management

View and monitor vendor accounts, statistics, and basic information through the admin panel.

Overview

The vendor management page provides administrators with a centralized view of all vendors on the platform, including key statistics and account details.

Page Location: WordPress Admin → WP Sell Services → Vendors

Access Required: manage_options capability (administrators only)

Accessing the Vendors Page

  1. Log in to WordPress admin
  2. Go to WP Sell Services → Vendors (submenu of WP Sell Services)
  3. Page slug: wpss-vendors

Dashboard Statistics

The vendors page displays 4 statistics cards:

Total Vendors

  • Count of all vendors in wpssvendorprofiles table
  • All statuses included in count

Active

  • Count of vendors with status = 'active'
  • Color: Green highlight

Pending

  • Count of vendors with status = 'pending'
  • Vendors awaiting approval (if approval required)

Suspended

  • Count of vendors with status = 'suspended'
  • Temporarily restricted accounts

Additional statistics shown:

  • Average Rating: Average of avg_rating column across all vendors (rounded to 2 decimals)
  • Total Earnings: Sum of total_earnings from all vendor profiles

Vendor List Table

The main table displays all vendors with sortable columns:

Columns

ColumnData SourceDescriptionSortable
Vendoru.display_nameVendor name and emailYes (by display_name)
ServicesCOUNT of wpss_service postsNumber of published servicesNo
Ordersvp.total_ordersTotal orders completedYes
Earningsvp.total_earningsTotal lifetime earningsYes (by total_earned)
Ratingvp.avg_ratingAverage customer ratingYes
LevelCalculatedSeller level badgeNo
Statusvp.statusAccount status badgeNo
Joinedu.user_registeredRegistration dateYes (by created_at)

Vendor Column Details

Shows vendor name linked to detail view:

  • Display name (linked to ?action=view&vendor_id=[id])
  • Email address below name (smaller text)

Services Column

Count of published services query:

SELECT COUNT(*) FROM wp_posts p
WHERE p.post_author = vp.user_id
AND p.post_type = 'wpss_service'
AND p.post_status = 'publish'

Sorting

Default sort: created_at DESC (newest first)

Available sort columns:

  • created_at – Registration date
  • display_name – Vendor name (alphabetical)
  • rating – Average rating (avg_rating column)
  • total_orders – Order count
  • total_earned – Lifetime earnings

URL parameters: ?orderby=[column]&order=[ASC|DESC]

Filtering Vendors

Status Filter

Filter tabs above table:

  • All – All vendors regardless of status
  • Activestatus = 'active' only
  • Pendingstatus = 'pending' only
  • Suspendedstatus = 'suspended' only

URL parameter: ?status=[status]

Search

Search box searches in:

  • Vendor display name (u.display_name)
  • Email address (u.user_email)

URL parameter: ?s=[search_term]

Uses LIKE %search% query with $wpdb->esc_like().

Vendor Detail View

Click vendor name to view detailed profile.

URL: ?action=view&vendorid=[userid]

Note: The source code shows vendor detail rendering via rendervendordetail() method, but implementation details require reading additional vendor profile files which weren’t fully reviewed. The detail view exists but specific tabs/content need verification from VendorProfileRepository and related classes.

Vendor Registration Status

Pending Status

Vendors with status = 'pending' are awaiting approval.

Approval Required Setting:

Checked in VendorService::register():

$vendor_settings = get_option( 'wpss_vendor', array() );
$require_verification = ! empty( $vendor_settings['require_verification'] );
$default_status = $require_verification ? 'pending' : 'active';

If wpssvendor['requireverification'] is enabled:

  • New vendors start with status = 'pending'
  • Require admin approval before active

If disabled:

  • New vendors start with status = 'active'
  • Immediately active upon registration

Approving Vendors

Approval functionality handled through AJAX action: wpssupdatevendor_status

Changes vendor status from pending to active.

Vendor Statuses

Three main statuses defined:

StatusDescription
activeFull access, can create services and accept orders
pendingAwaiting approval, limited access
suspendedTemporarily restricted, cannot receive new orders

Status stored in wpssvendorprofiles.status column.

Vendor Profile Database

Table: wpssvendorprofiles

Key columns (from VendorProfileRepository):

  • userid – Foreign key to wpusers (PRIMARY)
  • display_name – Vendor display name
  • tagline – Short tagline
  • bio – Full biography
  • country – Country location
  • city – City location
  • status – Account status (active/pending/suspended)
  • verification_tier – Tier: basic/verified/pro
  • avg_rating – Average rating (calculated)
  • total_orders – Total completed orders
  • total_earnings – Lifetime earnings
  • created_at – Profile creation timestamp
  • updated_at – Last update timestamp

Verification Tiers

Three tiers defined in VendorService:

public const TIER_BASIC    = 'basic';
public const TIER_VERIFIED = 'verified';
public const TIER_PRO      = 'pro';

New vendors start at TIER_BASIC.

Vendor Capabilities

Vendor Role

Role slug: wpss_vendor (defined in VendorService::ROLE)

Adding Vendor Role

When user becomes vendor via VendorService::register():

  1. Check user exists
  2. Check not already vendor
  3. Add wpssvendor role via $user->addrole()
  4. Verify role added successfully
  5. Add vendor capabilities
  6. Create vendor profile
  7. Set user meta:

Checking Vendor Status

Method: VendorService::isvendor($userid)

Checks:

  1. User has wpss_vendor role
  2. OR wpssis_vendor user meta is true

Returns boolean.

AJAX Actions

Update Vendor Status

Action: wpssupdatevendor_status

Nonce: wpssvendorsadmin

Changes vendor status (pending → active, active → suspended, etc.).

Get Vendor Details

Action: wpssgetvendor_details

Nonce: wpssvendorsadmin

Returns vendor profile details for detail view.

Update Vendor Commission [PRO]

Action: wpssupdatevendor_commission

Nonce: wpssvendorsadmin

Override global commission rate for specific vendor.

Get Tab Content

Action: wpssvendortab_content

Nonce: wpssvendorsadmin

Load content for vendor detail tabs (services, orders, reviews, earnings).

Update Vendor Vacation

Action: wpssupdatevendor_vacation

Nonce: wpssvendorsadmin

Toggle vendor vacation mode.

Update Vendor Availability

Action: wpssupdatevendor_availability

Nonce: wpssvendorsadmin

Update vendor availability settings.

Vendor Query

Get Vendors Method

Query in VendorsPage::get_vendors():

SELECT
    vp.*,
    u.display_name,
    u.user_email,
    u.user_registered,
    (SELECT COUNT(*) FROM wp_posts p
     WHERE p.post_author = vp.user_id
     AND p.post_type = 'wpss_service'
     AND p.post_status = 'publish') as services_count
FROM wp_wpss_vendor_profiles vp
LEFT JOIN wp_users u ON vp.user_id = u.ID
WHERE [filters]
ORDER BY [orderby] [order]
LIMIT [per_page] OFFSET [offset]

Pagination:

  • Default: 20 vendors per page
  • URL parameter: paged
  • Total pages: ceil(total / per_page)

JavaScript Localization

The page localizes wpssVendors object:

{
    ajaxUrl: admin_url('admin-ajax.php'),
    nonce: wp_create_nonce('wpss_vendors_admin'),
    i18n: {
        confirmStatusChange: 'Are you sure you want to change this vendor\'s status?',
        loading: 'Loading...',
        error: 'An error occurred. Please try again.'
    }
}

WordPress Hooks

Action: Vendor Registered

Fires when new vendor is registered:

/**
 * Fires when a new vendor is registered.
 *
 * @param int   $user_id      User ID.
 * @param array $profile_data Profile data.
 */
do_action( 'wpss_vendor_registered', $user_id, $profile_data );

Technical Details

Page Hook: sell-servicespagewpss-vendors

Stylesheets:

  • wpss-free-admin – Main admin CSS (assets/css/admin.css)

Scripts:

  • wpss-free-admin – Main admin JS (assets/js/admin.js)

Database Tables:

  • wpssvendorprofiles – Vendor profile data
  • wpposts – Services (posttype = ‘wpss_service’)
  • wp_users – User accounts

Vendor Statistics Calculation

Statistics query in getvendorstats():

SELECT
    COUNT(*) as total_vendors,
    SUM(CASE WHEN status = 'active' THEN 1 ELSE 0 END) as active_vendors,
    SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END) as pending_vendors,
    SUM(CASE WHEN status = 'suspended' THEN 1 ELSE 0 END) as suspended_vendors,
    AVG(avg_rating) as avg_rating,
    SUM(total_earnings) as total_earnings
FROM wp_wpss_vendor_profiles

Returns aggregate counts and averages across all vendors.

Limitations in Free Version

The free version vendor management is view-only with basic filtering:

  • View vendor list and statistics
  • Filter by status and search
  • Sort by various columns
  • View basic vendor details

Not included in free version:

  • Vendor approval workflow UI (requires manual status updates)
  • Commission rate overrides per vendor
  • Advanced vendor analytics
  • Bulk actions on vendors
  • Custom vendor notes
  • Vendor suspension with reason tracking
  • Detailed vendor performance reports

For full vendor management features, see the Pro version documentation.

Next Steps

Last updated: February 14, 2026