Lesson 68: Build the Buyer Transaction Details Page


Why This Lesson?

In Lesson 67, buyers gained a My Purchases dashboard listing all their purchased websites.

The next logical step is allowing buyers to click a purchase and view complete transaction information, just as administrators can from the WordPress dashboard.

This improves transparency and prepares the platform for payment confirmation, invoices, and future escrow integration.


What We Will Build

Instead of showing only:

AuctionWinning BidStatusPurchased

buyers will be able to click View Details and see a dedicated transaction page.

Example:

Transaction Details

Auction:
Wpnzee.com

Winning Bid:
₹55,555,609.00

Status:
Paid

Purchase Date:
6 July 2026

Seller:
Flipnzee

Buyer:
Rajeev Bagra

Transaction ID:
#2

Features

During this lesson we will:

  • Create a Buyer Transaction Details shortcode.
  • Pass the transaction ID securely.
  • Verify that the logged-in user owns the transaction.
  • Retrieve the transaction from the database.
  • Display all transaction information.
  • Prevent unauthorized users from viewing someone else’s purchases.

Files Expected to Change

includes/class-my-purchases.php
includes/class-my-purchase-details.php
includes/class-shortcodes.php
flipnzee-auctions.php

New Shortcode

[flipnzee_purchase_details]

New Workflow

Buyer Login
      │
      ▼
My Purchases
      │
      ▼
View Details
      │
      ▼
Purchase Details

Skills You’ll Learn

  • Passing IDs through URLs
  • Secure ownership verification
  • Database lookups using $wpdb->prepare()
  • Protecting private user data
  • Building frontend detail pages
  • Creating reusable shortcode-based pages

Expected Outcome

By the end of Lesson 68, every buyer will have:

  • A purchase history page (completed in Lesson 67).
  • A dedicated page for each purchase.
  • Secure access limited to their own transactions.
  • A foundation for future features such as payment receipts, invoices, escrow updates, download links, and support requests.

Why this is a better priority than a Seller Dashboard

Since Flipnzee Version 1 will only list websites sold by your own business, you already manage sales through the WordPress admin:

  • Listings
  • Bids
  • Transactions
  • Transaction Details
  • Activity Log

Your buyers, however, have no admin access. Enhancing their experience adds more value for Version 1 and lays the groundwork for future marketplace capabilities.

Lesson 67 Implementation: Building the Buyer Dashboard with the My Purchases Shortcode


One of the first features buyers expect after winning an auction is the ability to review their purchases. In Lesson 67, the Flipnzee Auctions plugin gained a dedicated buyer dashboard through a new shortcode called My Purchases.

Instead of forcing buyers to contact the administrator or search through emails, they can now view their completed and pending purchases directly from a WordPress page.


What We Built

During this lesson, a new class named Flipnzee_My_Purchases was created to handle the buyer dashboard.

The class:

  • Checks whether the visitor is logged in.
  • Retrieves transactions belonging to the current buyer.
  • Displays a friendly message if there are no purchases.
  • Outputs a purchase table using a shortcode.

The new shortcode is:

[flipnzee_my_purchases]

This allows the dashboard to be placed on any WordPress page.


Loading the New Class

A new file was created:

includes/class-my-purchases.php

The class was then loaded inside the main plugin file using require_once, ensuring it is available whenever the plugin loads.

As always, syntax was verified after making the change using:

php -l includes/class-my-purchases.php

Registering the Shortcode

The shortcode was registered inside the shortcode manager.

This makes the following shortcode available throughout WordPress:

[flipnzee_my_purchases]

From this point onwards, any page can become a buyer dashboard simply by inserting this shortcode.


Retrieving Buyer Transactions

The next task was querying the custom transactions table.

Only transactions belonging to the currently logged-in buyer are retrieved.

The query filters records using the current WordPress user ID and orders them from newest to oldest.

If no purchases exist, a friendly message is displayed instead of an empty table.


Displaying Purchase Information

Once the data was retrieved successfully, a responsive HTML table was generated.

Initially the table displayed:

  • Listing ID
  • Winning Bid
  • Status
  • Purchase Date

Testing confirmed that multiple purchases were displayed correctly.


Improving the User Experience

The Listing ID was later replaced with the actual listing title using WordPress functions.

Instead of displaying:

491

buyers now see something like:

Wpnzee.com

This makes the dashboard far easier to understand.


Making Listings Clickable

The listing title was then converted into a hyperlink.

Buyers can now click directly on the purchased website to revisit the listing page.

This small enhancement greatly improves navigation throughout the marketplace.


Formatting Currency

Winning bid values were originally displayed as raw numbers:

55555609.00

The output was improved using PHP’s number_format() function together with the Rupee symbol.

The dashboard now displays:

₹55,555,609.00

which is much more readable and professional.


Final Result

The completed buyer dashboard now displays:

AuctionWinning BidStatusPurchased
Wpnzee.com₹55,555,609.00Paid2026-07-06 05:42:05
Wpnzee.com₹55,555,609.00Pending2026-07-06 05:36:13

Each listing title links directly to its auction page.


Lessons Learned

A few important development practices were reinforced during this lesson:

  • Separate business logic into dedicated classes.
  • Keep database queries limited to the logged-in user.
  • Escape all displayed output using esc_html() and esc_url().
  • Prefer meaningful titles over internal database IDs.
  • Format monetary values for readability.
  • Test every incremental change before moving to the next step.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Why This Feature Matters

This lesson marks an important milestone for Flipnzee Auctions.

Until now, most development focused on the administrator’s workflow—creating auctions, recording bids, generating transactions, and managing activity logs.

Lesson 67 introduces the first dedicated buyer-facing dashboard, allowing users to monitor their purchases without administrator assistance.

As the platform grows, this dashboard can be expanded with payment history, downloadable invoices, escrow updates, transaction completion status, and buyer support tools.

Even in its current form, it provides a solid foundation for a professional auction marketplace and brings Flipnzee one step closer to a production-ready Version 1 release.

Lesson 67: Building the “My Purchases” Dashboard for Buyers


Overview

In the previous lessons, we completed the backend transaction workflow:

  • Auctions close automatically.
  • Winners are determined.
  • Transactions are created.
  • Administrators can manage transactions.
  • Administrators can inspect detailed transaction information.

However, buyers currently have no way to see the auctions they have won.

In this lesson, we will build the first user-facing transaction dashboard by introducing a My Purchases page.


Why This Lesson Matters

Imagine winning an auction on Flipnzee.com.

After placing the winning bid, you naturally expect to see:

  • What did I buy?
  • What was my winning bid?
  • Has the seller been notified?
  • Has payment been received?
  • Has the domain transfer started?

Without a buyer dashboard, users would need to contact support for every update.

The My Purchases page solves this problem.


Current Workflow

Auction

↓

Winner

↓

Transaction

↓

Administrator

New Workflow

Auction

↓

Winner

↓

Transaction

↓

Buyer Dashboard

What We’ll Build

A new shortcode:

[flipnzee_my_purchases]

When a logged-in buyer visits the page, they’ll see:

AuctionWinning BidStatusPurchased
PremiumDomain.com₹55,000Pending6 Jul 2026
ExampleSite.com₹25,000Paid3 Jul 2026

If the visitor is not logged in, they’ll see a friendly message asking them to sign in.


Files We’ll Modify

New

includes/class-my-purchases.php

Modify

flipnzee-auctions.php

Modify

includes/class-shortcodes.php

Reuse

includes/class-transaction-manager.php

Features

Step 1

Create the My Purchases class.


Step 2

Register the shortcode.


Step 3

Verify the user is logged in.


Step 4

Retrieve transactions where:

buyer_id = current_user_id()

Step 5

Display purchases in a WordPress table.


Step 6

Show:

  • Listing
  • Winning Bid
  • Status
  • Purchase Date

Step 7

Handle empty results gracefully.

Example:

You haven't purchased any auctions yet.

Expected Result

Logged-in buyers will see:

My Purchases

------------------------------------------------

Listing

PremiumDomain.com

Winning Bid

₹55,555

Status

Paid

Purchased

6 July 2026

------------------------------------------------

ExampleSite.com

Winning Bid

₹10,000

Status

Pending

Purchased

5 July 2026

Guests will see:

Please log in to view your purchases.

Future Enhancements

This page is intentionally designed to grow over time. Future lessons can extend it with:

  • View Transaction link
  • Escrow progress
  • Payment confirmation
  • Domain transfer status
  • Seller contact (when appropriate)
  • Transaction timeline
  • Download invoice
  • Email history

Skills You’ll Practice

  • WordPress shortcodes
  • User authentication
  • Current user retrieval
  • Database queries with prepared statements
  • Frontend table rendering
  • Secure output escaping
  • User dashboard design

Difficulty Level

Intermediate

This lesson introduces the first buyer-facing dashboard in the Flipnzee Auctions plugin. It connects the backend transaction system to the frontend, giving buyers immediate visibility into their purchases while establishing a reusable pattern for future user dashboards such as My Sales, My Auctions, and My Bids.


Why This Is the Right Next Step

From a marketplace perspective, this lesson provides immediate value to end users. Administrators already have the tools to manage auctions and transactions, but buyers need confidence that the platform is tracking their purchases. By introducing My Purchases, Flipnzee becomes more than an admin-managed auction system—it begins to function as a true online marketplace where users can monitor their own activity. This also lays the groundwork for future escrow updates, payment tracking, and ownership transfer notifications.

Lesson 66 Implementation: Building a Transaction Details Page for Completed Auctions

One of the biggest advantages of developing your own WordPress plugin is that you can continuously improve the user experience. In the previous lessons, the Flipnzee Auctions plugin was already creating transactions automatically after an auction ended and displaying them in a Transactions table. However, there was no way to inspect a transaction in detail.

In this lesson, a dedicated Transaction Details page was introduced. This page provides administrators with complete information about an individual auction transaction and lays the foundation for future features such as escrow management, payment verification, domain transfer tracking, and audit logs.


What We Built

Instead of only viewing a transaction inside a table, administrators can now click a View action to open a dedicated page displaying all transaction information.

Current information displayed includes:

  • Transaction ID
  • Auction ID
  • Listing ID
  • Seller ID
  • Buyer ID
  • Winning Bid
  • Transaction Status
  • Created Date
  • Updated Date

This provides a much cleaner workflow compared to searching through database records manually.


Step 1 – Creating the Transaction Details Admin Page

A new admin class was created:

admin/class-admin-transaction-details.php

This class is responsible for rendering the Transaction Details screen inside the WordPress admin dashboard.

Initially, the page only displayed a placeholder message while the routing and menu registration were tested.


Step 2 – Registering the Admin Page

The new page was registered inside the plugin’s admin menu.

Unlike normal menu pages, this page is hidden from the sidebar because it is accessed directly from the Transactions table using a URL similar to:

admin.php?page=flipnzee-transaction-details&transaction_id=2

This keeps the admin menu clean while still allowing administrators to access detailed information.


Step 3 – Loading Transaction Data

Inside the render_page() method, the transaction ID is safely retrieved using:

$transaction_id = isset( $_GET['transaction_id'] )
	? absint( $_GET['transaction_id'] )
	: 0;

Using absint() ensures only valid numeric IDs are accepted.

The transaction is then retrieved from the custom database table using a prepared SQL query.

This protects the plugin against SQL injection while ensuring the correct transaction is loaded.


Step 4 – Handling Invalid Transactions

Good plugins never assume that data always exists.

If an invalid transaction ID is supplied, the plugin now displays an error message instead of generating PHP warnings or fatal errors.

Example:

Transaction not found.

This small validation greatly improves the robustness of the plugin.


Step 5 – Displaying Transaction Information

After confirming that the transaction exists, the placeholder content was replaced with a professional information table.

The page now displays:

FieldDescription
IDInternal transaction ID
AuctionAuction record ID
ListingWordPress listing ID
SellerSeller user ID
BuyerBuyer user ID
Winning BidFinal auction amount
StatusCurrent transaction status
CreatedCreation timestamp
UpdatedLast update timestamp

This information is presented using a WordPress widefat striped table for a consistent admin experience.


Step 6 – Troubleshooting During Development

Like most real-world development sessions, implementation was not completely straightforward.

Several issues were encountered, including:

  • PHP parse errors caused by misplaced braces.
  • Accidental duplication of an if statement during copy-and-paste.
  • Mixed HTML and PHP tags while replacing placeholder content.
  • Leftover placeholder code causing unexpected output.
  • Additional syntax validation before uploading the plugin.

Each issue was resolved by:

  • Running PHP syntax checks:
php -l admin/class-admin-transaction-details.php
  • Carefully reviewing opening and closing braces.
  • Replacing only the affected code block instead of rewriting the entire file.
  • Testing after every small change.

This incremental debugging approach made it much easier to locate and resolve problems.


Final Result

The Flipnzee Auctions plugin now includes a dedicated Transaction Details page.

Administrators can:

  • Open a completed transaction
  • View all important transaction information
  • Verify buyer and seller IDs
  • Review the winning bid
  • Check the current transaction status
  • See creation and update timestamps

The page is now ready for future enhancements without requiring any structural redesign.


Why This Matters

Although this page currently displays basic information, it establishes the foundation for a complete transaction management system.

Future lessons can build upon this page by adding:

  • Buyer profile links
  • Seller profile links
  • Listing title instead of ID
  • Auction title
  • Escrow status
  • Payment history
  • Domain transfer progress
  • Shipping information (for physical products)
  • Internal administrator notes
  • Activity timeline
  • Email history
  • Downloadable invoices

Because the framework is already in place, adding these features will be much easier.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Lessons Learned

During this implementation, several important development practices were reinforced:

  • Build features incrementally rather than all at once.
  • Validate user input before querying the database.
  • Always use prepared SQL statements.
  • Check for missing records gracefully.
  • Run PHP syntax checks before uploading changes.
  • Test every modification immediately to catch errors early.
  • Use dedicated detail pages instead of overcrowding list tables.

Conclusion

Lesson 66 significantly improves the administrative experience of the Flipnzee Auctions plugin. Instead of viewing transactions only in a summary table, administrators can now inspect individual transactions on a dedicated page with all essential details.

More importantly, this page serves as the foundation for advanced transaction management features planned for future lessons, bringing the plugin another step closer to a production-ready auction platform.

Lesson 66: Building a Transaction Details Page for Flipnzee Auctions


Overview

In previous lessons, we built a complete transaction workflow:

  • Auctions close automatically.
  • Winners are determined.
  • Transactions are created automatically.
  • Administrators can view transactions.
  • Transaction statuses can be updated.

However, administrators still cannot inspect an individual transaction in detail.

In this lesson, we’ll build a dedicated Transaction Details page where administrators can view every aspect of a completed auction before moving on to escrow, payment, or ownership transfer.


What You Will Learn

In this lesson you will learn how to:

  • Create an admin details page.
  • Read a single transaction securely.
  • Display auction information.
  • Display buyer and seller information.
  • Display listing information.
  • Display winning bid information.
  • Display transaction timeline.
  • Prepare the page for escrow integration.

Why This Lesson Matters

Imagine receiving an email from a buyer asking:

“Has my payment been received?”

Currently an administrator would need to search several database tables.

Instead, we’ll provide a dedicated transaction page showing everything in one place.


Current Workflow

Auction

↓

Winner

↓

Transaction

↓

Transactions Table

New Workflow

Auction

↓

Winner

↓

Transaction

↓

Transactions Table

↓

Transaction Details

What We’ll Build

Each transaction will have a View action.

Example:

ID      Status

31      Pending

View

Clicking View opens:

Transaction #31

Auction
-----------------------------------
Auction ID
Listing
Winning Bid

Buyer
-----------------------------------
Username
Email

Seller
-----------------------------------
Username
Email

Status
-----------------------------------
Pending

Created

Last Updated

Files We’ll Modify

New

admin/class-admin-transaction-details.php

Modify

admin/class-admin-transactions.php

Modify

admin/class-transactions-table.php

Reuse

includes/class-transaction-manager.php

Features

Step 1

Create Transaction Details page.


Step 2

Register submenu page.


Step 3

Add View action.


Step 4

Load transaction.


Step 5

Display buyer details.


Step 6

Display seller details.


Step 7

Display auction details.


Step 8

Display transaction status.


Step 9

Display timestamps.


Step 10

Prepare escrow section placeholder.


Example Page

------------------------------------------------

Transaction #12

Status
Pending

-----------------------------------------------

Auction

Auction ID: 31

Listing:
PremiumDomain.com

Winning Bid:
₹55,555,609

-----------------------------------------------

Buyer

Username:
John

Email:
[email protected]

-----------------------------------------------

Seller

Username:
Rajeev

Email:
[email protected]

-----------------------------------------------

Created

2026-07-06 14:25

Updated

2026-07-06 14:31

------------------------------------------------

Future Escrow Section

The page will intentionally leave space for:

Escrow Provider

Payment Status

Escrow ID

Release Funds

Release Domain

Complete Transaction

These features will be implemented in later lessons without redesigning the page.


Skills You’ll Practice

  • WordPress admin pages
  • Secure URL parameters
  • Database lookups
  • WordPress user functions
  • Data presentation
  • Preparing for escrow integration
  • Clean admin UI design

Difficulty Level

Intermediate

This lesson combines custom admin pages, database retrieval, and structured data presentation. It also establishes the administrative workflow that will support escrow services, payment processing, and domain or website transfers in future lessons.


Final Thoughts

Lesson 66 marks another important milestone in the Flipnzee Auctions plugin. Instead of treating transactions as simple database records, administrators will be able to inspect every completed auction from a single screen. This improves usability, simplifies support, and creates the ideal foundation for integrating escrow providers, payment gateways, email notifications, and ownership transfer workflows as the plugin moves closer to powering live auctions on Flipnzee.com.

Lesson 65 Implementation: Adding Transaction Status Management to Flipnzee Auctions

After building the Transactions dashboard in the previous lesson, the next improvement was to make the transactions interactive. Instead of simply displaying transaction records, administrators should be able to manage the progress of each transaction as the auction moves through its post-sale lifecycle.

In this lesson, we implemented the foundation for transaction status management, allowing administrators to update transaction statuses securely from the WordPress admin area while recording every status change in the activity log.


Objective

The goal of this lesson was to transform the Transactions page from a read-only report into the beginning of a transaction management system.

Instead of every transaction remaining permanently in a Pending state, administrators can now move transactions through different stages.


Initial Workflow

Before this lesson, every completed auction produced a transaction like this:

TransactionStatus
#1Pending
#2Pending

Although transactions were stored correctly, there was no mechanism to update their progress.


Step 1 — Extend the Transaction Manager

The first task was adding a reusable method responsible for updating transaction status.

File modified:

includes/class-transaction-manager.php

Method added:

/**
 * Update a transaction status.
 *
 * @param int    $transaction_id Transaction ID.
 * @param string $status         New status.
 * @return bool
 */
public static function update_status(
	$transaction_id,
	$status
) {

	global $wpdb;

	$table = $wpdb->prefix . 'flipnzee_transactions';

	$updated = $wpdb->update(
		$table,
		array(
			'status' => sanitize_text_field( $status ),
		),
		array(
			'id' => absint( $transaction_id ),
		),
		array(
			'%s',
		),
		array(
			'%d',
		)
	);

	if ( class_exists( 'Flipnzee_Activity_Log' ) ) {

		Flipnzee_Activity_Log::log(
			'transaction_status_updated',
			0,
			get_current_user_id(),
			sprintf(
				'Transaction #%d marked as %s.',
				$transaction_id,
				$status
			)
		);
	}

	return false !== $updated;
}

This method centralizes all transaction status updates in one location.


Step 2 — Register an Admin Action

To process status changes securely, a new WordPress admin action was registered.

File modified:

flipnzee-auctions.php

Code added:

add_action(
	'admin_post_flipnzee_update_transaction_status',
	array(
		'Flipnzee_Transaction_Manager',
		'handle_status_update',
	)
);

This allows WordPress to execute a custom handler whenever an administrator clicks a transaction action link.


Step 3 — Handle Status Updates Securely

Next, a dedicated handler method was implemented.

public static function handle_status_update() {

	if ( ! current_user_can( 'manage_options' ) ) {
		wp_die( 'Permission denied.' );
	}

	check_admin_referer(
		'flipnzee_update_transaction'
	);

	$transaction_id = isset( $_GET['transaction_id'] )
		? absint( $_GET['transaction_id'] )
		: 0;

	$status = isset( $_GET['status'] )
		? sanitize_text_field(
			wp_unslash( $_GET['status'] )
		)
		: '';

	if ( $transaction_id && $status ) {

		self::update_status(
			$transaction_id,
			$status
		);
	}

	wp_safe_redirect(
		admin_url(
			'admin.php?page=flipnzee-transactions'
		)
	);

	exit;
}

The handler performs several important tasks:

  • verifies administrator permissions,
  • validates the WordPress nonce,
  • sanitizes user input,
  • updates the transaction,
  • redirects back to the Transactions page.

Step 4 — Add Status Action Links

The Transactions table was enhanced by creating a custom renderer for the Status column.

File modified:

admin/class-transactions-table.php

Method added:

public function column_status( $item ) {

	$status = esc_html( ucfirst( $item['status'] ) );

	$actions = array();

	if ( 'pending' === $item['status'] ) {

		$url = wp_nonce_url(
			admin_url(
				'admin-post.php?action=flipnzee_update_transaction_status'
				. '&transaction_id=' . $item['id']
				. '&status=paid'
			),
			'flipnzee_update_transaction'
		);

		$actions['paid'] =
			'<a href="' . esc_url( $url ) . '">Mark Paid</a>';

	} elseif ( 'paid' === $item['status'] ) {

		$url = wp_nonce_url(
			admin_url(
				'admin-post.php?action=flipnzee_update_transaction_status'
				. '&transaction_id=' . $item['id']
				. '&status=completed'
			),
			'flipnzee_update_transaction'
		);

		$actions['completed'] =
			'<a href="' . esc_url( $url ) . '">Mark Completed</a>';
	}

	return sprintf(
		'%1$s %2$s',
		$status,
		$this->row_actions( $actions )
	);
}

This introduces workflow-oriented actions directly into the Transactions page.


Step 5 — Testing the Workflow

After uploading the updated plugin, several scenarios were tested.

Successful observations included:

  • Transaction status changed from Pending to Paid.
  • The database updated correctly.
  • The Activity Log recorded the status change.
  • Administrators were redirected back to the Transactions page after the update.

This confirmed that the backend workflow was functioning as intended.


Challenges Encountered

During implementation, several issues arose that provided valuable learning opportunities.

Duplicate Methods

While extending the Transaction Manager, a duplicate update_status() method was accidentally created, resulting in a fatal PHP error. Removing the duplicate resolved the issue and reinforced the importance of keeping classes organized.

PHP Syntax Errors

While adding new methods, braces were temporarily misplaced, causing syntax errors. Incremental syntax checking with:

php -l includes/class-transaction-manager.php

helped identify and correct these mistakes before deployment.

Transactions Table Rendering

The custom Transactions table successfully displayed transaction data and action links. Status updates from Pending to Paid worked correctly, and the database reflected the changes. However, the “Mark Completed” action did not appear after a transaction entered the Paid state.

This did not affect the underlying transaction workflow or status updates, but highlighted a rendering issue within the current WP_List_Table implementation. Since the core transaction management functionality was already operational, further refinement of the table interface was deferred to a future lesson focused on polishing the admin experience.


Lessons Learned

This lesson demonstrated several important WordPress development practices:

  • Separate business logic from user interface rendering.
  • Protect administrative actions with nonces.
  • Verify user capabilities before processing requests.
  • Centralize database updates inside dedicated manager classes.
  • Record important business events in an activity log.
  • Test functionality incrementally after every major change.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:

Final Outcome

By the end of Lesson 65, the Flipnzee Auctions plugin evolved beyond simply storing transactions. Administrators can now begin managing the transaction lifecycle by updating statuses securely through the WordPress admin interface. Although some interface refinements remain for future lessons, the underlying architecture for transaction status management is now in place.

This implementation provides a solid foundation for the next phase of development, where transaction status changes will be connected to buyer and seller notifications, escrow integration, payment workflows, and ownership transfer processes, bringing the plugin closer to supporting real-world online auctions on Flipnzee.com.

Lesson 65: Adding Transaction Status Management to Flipnzee Auctions


What You’ll Learn

In this lesson, you’ll enhance the Transactions page by allowing administrators to change the status of auction transactions directly from the WordPress dashboard.

By the end of this lesson, you’ll be able to:

  • Display transaction status as a clickable action
  • Add row actions to each transaction
  • Update transaction status securely
  • Use WordPress nonces for protection
  • Process admin actions with custom handlers
  • Record status changes in the activity log

Why This Matters

Currently every transaction is stored like this:

IDStatus
1pending
2pending

Once payment is received or the website/domain has been transferred, an administrator needs a way to mark the transaction as:

  • Pending
  • Paid
  • Completed
  • Cancelled
  • Refunded (future lesson)

Without this capability, the transaction system is read-only.


What We’ll Build

We’ll transform this:

Status
pending

into something like:

Status
Pending

[Mark Paid]

Later:

Status
Paid

[Mark Completed]

Finally:

Status
Completed

Files We’ll Modify

  • admin/class-admin-transactions.php
  • includes/class-transaction-manager.php
  • includes/class-activity-log.php
  • flipnzee-auctions.php

Features We’ll Implement

Step 1

Create transaction status update method.


Step 2

Add admin action handler.


Step 3

Verify WordPress nonce.


Step 4

Update transaction status in database.


Step 5

Write activity log entry.


Step 6

Display success notice.


Step 7

Add “Mark Paid” row action.


Step 8

Add “Mark Completed” row action.


Step 9

Hide actions once transaction is completed.


Step 10

Test the complete workflow.


Expected Result

Instead of only viewing transactions, administrators will be able to manage their progress:

Transaction #5

Status: Pending

Actions:
✓ Mark Paid

Status: Paid

Actions:
✓ Mark Completed

Status: Completed

Skills You’ll Learn

  • WordPress admin action handlers
  • Secure nonce verification
  • Updating custom database tables
  • Admin notices
  • Row actions in WP_List_Table
  • Activity logging
  • Transaction workflow design

End Result

After Lesson 65, the Flipnzee Auctions plugin will evolve from simply recording transactions to managing the full transaction lifecycle. Administrators will be able to move transactions through meaningful stages—such as Pending, Paid, and Completed—while every status change is securely processed and automatically recorded in the activity log. This creates a practical workflow for handling completed auctions and prepares the plugin for future enhancements like payment gateway integration, downloadable invoices, email notifications, refunds, and commission tracking.

Lesson 64 Implementation: Creating the Transactions Admin Page in Flipnzee Auctions

After completing automatic transaction generation in Lesson 63, the next step was to allow administrators to view all completed auction transactions directly from the WordPress dashboard.

In this lesson, we created a dedicated Transactions admin page that displays every transaction stored in the plugin’s custom database table. This gives administrators a centralized place to monitor completed sales and lays the groundwork for future payment processing, invoices, commissions, refunds, and reporting.


What We Built

By the end of this lesson, the plugin includes:

  • A new Transactions submenu
  • A custom admin page
  • A WP_List_Table based transactions table
  • Automatic loading of transaction records
  • Display of important transaction information
  • Professional WordPress admin interface

Step 1 — Create the Transactions Table Class

Inside the admin folder create:

admin/class-admin-transactions.php

This file is responsible for:

  • Loading the transactions page
  • Creating the transactions table
  • Displaying all stored transactions

Step 2 — Create the Transactions List Table

Inside the same file create a class extending WP_List_Table.

Example:

class Flipnzee_Transactions_Table extends WP_List_Table {

}

This gives us the familiar WordPress admin table interface.


Step 3 — Define Table Columns

Create the columns method.

public function get_columns() {

    return array(
        'id'          => 'ID',
        'auction_id'  => 'Auction',
        'listing_id'  => 'Listing',
        'seller_id'   => 'Seller',
        'buyer_id'    => 'Buyer',
        'winning_bid' => 'Winning Bid',
        'status'      => 'Status',
        'created_at'  => 'Created',
    );
}

These columns match the structure of the custom transactions database table.


Step 4 — Load Transactions From Database

Inside prepare_items() we queried the database.

global $wpdb;

$table = $wpdb->prefix . 'flipnzee_transactions';

$this->items = $wpdb->get_results(
    "SELECT * FROM {$table} ORDER BY id DESC",
    ARRAY_A
);

The newest transactions now appear first.


Step 5 — Configure Table Headers

Still inside prepare_items() we configured the table headers.

$this->_column_headers = array(
    $columns,
    array(),
    array(),
    'id',
);

This tells WordPress which columns should appear.


Step 6 — Display Column Values

Next we created the default column renderer.

public function column_default( $item, $column_name ) {

    return isset( $item[ $column_name ] )
        ? esc_html( $item[ $column_name ] )
        : '';
}

This automatically outputs the correct value for each column.


Step 7 — Register the Transactions Menu

Inside class-admin.php we added another submenu.

add_submenu_page(
    'flipnzee-auctions',
    'Transactions',
    'Transactions',
    'manage_options',
    'flipnzee-transactions',
    array( $this, 'transactions_page' )
);

The new menu now appears beneath Flipnzee Auctions.


Step 8 — Create the Page Callback

The callback loads and displays the table.

Example:

$table = new Flipnzee_Transactions_Table();

$table->prepare_items();

$table->display();

This is all that’s required for WordPress to render the table.


Step 9 — Load the New Admin File

Inside the main plugin file we loaded the new class.

require_once FLIPNZEE_AUCTION_PATH .
    'admin/class-admin-transactions.php';

Without this step the Transactions page would never load.


Step 10 — Test the Feature

After activating the updated plugin we verified everything worked correctly.

The Transactions page displayed:

  • Transaction ID
  • Auction ID
  • Listing ID
  • Seller
  • Buyer
  • Winning Bid
  • Status
  • Created Date

Every automatically generated transaction appeared successfully.


Result

The Flipnzee Auctions plugin now provides a dedicated Transactions dashboard for administrators.

When an auction ends and a winner is determined, the plugin now has the ability to:

  • Store the transaction
  • Display it inside WordPress
  • Allow administrators to monitor completed sales

This transforms the plugin from simply tracking auctions into managing the entire auction lifecycle.


What We Learned

In this lesson we learned how to:

  • Create a custom WordPress admin page
  • Use WP_List_Table
  • Display custom database records
  • Load transaction history
  • Register new admin submenu pages
  • Build a professional backend interface

Challenges Faced

During implementation we encountered a few issues that are common when building WordPress admin tables:

  • A misplaced method inside prepare_items() caused PHP syntax errors, which were resolved by moving get_table_classes() outside the method while keeping it inside the class.
  • Initially, the Transactions menu did not appear because the new admin file had not been included in the main plugin file.
  • After everything worked, an extra header row appeared at the bottom of the table. This is a cosmetic behavior of the simplified WP_List_Table implementation and does not affect functionality. It will be refined in a future lesson when we enhance sorting, pagination, and table styling.

Working through these issues reinforced the importance of careful class structure, proper file loading, and incremental testing during plugin development.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Final Outcome

By the end of Lesson 64, Flipnzee Auctions includes a fully functional Transactions management page that lists all automatically generated auction transactions. This provides administrators with immediate visibility into completed sales and establishes the foundation for future features such as payment integration, invoices, commissions, refunds, transaction status updates, and downloadable reports.

Lesson 64: Build a Transaction Management Dashboard in WordPress Admin


Objective

Create a dedicated Transactions page in the WordPress admin where administrators can monitor every completed auction transaction.

This will become the operational dashboard before adding escrow integration.


What We Will Build

A new admin menu:

Flipnzee Auctions
├── Auctions
├── Add Auction
├── Activity Log
├── Transactions   ← NEW

The page will display something like:

IDAuctionListingSellerBuyerWinning BidStatusCreated
131491RajeevRajeev$55,555,609PendingToday

Why This Lesson Matters

Right now:

  • Auctions close automatically ✅
  • Winner is determined ✅
  • Transaction is created ✅

But administrators cannot actually see or manage transactions.

A transaction dashboard is the natural bridge before adding:

  • Escrow integration
  • Payment processing
  • Buyer/Seller confirmation
  • Domain transfer workflow
  • Status updates

Files We’ll Modify

New

admin/class-transactions-table.php

A WordPress list table for transactions.


New

admin/class-admin-transactions.php

Renders the Transactions page.


Modify

admin/class-admin.php

Register the new submenu.


Reuse

includes/class-transaction-manager.php

Read transaction data from the database.


Features

1. Transactions Table

Display:

  • Transaction ID
  • Auction ID
  • Listing ID
  • Seller
  • Buyer
  • Winning Bid
  • Status
  • Created Date

2. Pagination

Support large numbers of transactions.


3. Search

Search by:

  • Auction ID
  • Listing ID
  • Buyer
  • Seller

4. Status Filter

Dropdown:

All
Pending
Escrow
Completed
Cancelled
Refunded

5. Sorting

Allow sorting by:

  • Date
  • Winning Bid
  • Status

6. Future Ready

We’ll design the table so adding action buttons later is easy:

View
Mark Escrow Received
Mark Completed
Cancel

Those buttons won’t do anything yet—they’ll be implemented in later lessons.


What We’ll Learn

During this lesson you’ll practice:

  • Creating another WP_List_Table
  • Reading custom database tables
  • Pagination
  • Searching
  • Sorting
  • Filtering
  • Secure admin pages
  • Preparing for escrow workflows

Expected Result

The admin will have a professional Transactions dashboard similar to WordPress Posts or Users.

Example:

-------------------------------------------------------------
 Transactions

 ID   Auction  Buyer      Seller     Winning Bid     Status
-------------------------------------------------------------
 1      31     Rajeev     Rajeev      $55,555,609    Pending
 2      32     Alice      Bob         $7,500         Completed
 3      33     John       Mary        $2,300         Escrow
-------------------------------------------------------------

Why This Is the Right Next Step

This lesson doesn’t just add another admin screen—it creates the control center for everything that happens after an auction ends. Once this dashboard exists, integrating an escrow provider becomes much simpler because every transaction will have a visible lifecycle (Pending → Escrow → Completed).

After Lesson 64, we’ll be in an excellent position to begin the escrow integration itself, keeping your focus on making Flipnzee.com ready to host real auctions.

Lesson 63 Implementation: Building an Event-Driven Transaction System for Flipnzee Auctions

After completing the database structure in Lesson 62, the next logical step was to automate what happens after an auction successfully ends.

Instead of tightly coupling transaction creation with the auction closing logic, this lesson introduced an event-driven architecture using WordPress hooks. This approach keeps the plugin modular and makes future integrations—such as escrow services, payment gateways, and notifications—much easier.


Objective

Automatically create a transaction record whenever an auction winner is determined.

By the end of this lesson:

  • Auction winner determination triggers an event.
  • The Transaction Manager listens for that event.
  • A transaction is automatically created.
  • The Activity Log records the transaction creation.

Step 1: Fire an Event After Determining the Winner

Winner determination is handled inside:

includes/class-bid-manager.php

After recording the winner in the Activity Log, add:

do_action(
	'flipnzee_auction_winner_determined',
	$auction_id,
	$winner
);

The end of the method becomes:

Flipnzee_Activity_Log::log(
	'winner_determined',
	$auction_id,
	$winner->bidder_id,
	sprintf(
		'Winning bid: %s',
		$winner->bid_amount
	)
);

do_action(
	'flipnzee_auction_winner_determined',
	$auction_id,
	$winner
);

return true;

This broadcasts an event without knowing who will respond to it.


Step 2: Create the Transaction Manager Listener

Open:

includes/class-transaction-manager.php

Add a constructor:

public function __construct() {

	add_action(
		'flipnzee_auction_winner_determined',
		array(
			$this,
			'create_transaction_from_auction',
		),
		10,
		2
	);
}

Whenever the event is fired, this callback will execute automatically.


Step 3: Build the Callback Method

Add the following method:

/**
 * Create transaction when an auction winner is determined.
 *
 * @param int    $auction_id Auction ID.
 * @param object $winner     Winning bid.
 * @return void
 */
public function create_transaction_from_auction(
	$auction_id,
	$winner
) {

	global $wpdb;

	$auction = $wpdb->get_row(
		$wpdb->prepare(
			"SELECT *
			FROM {$wpdb->prefix}flipnzee_auctions
			WHERE id = %d",
			$auction_id
		)
	);

	if ( ! $auction ) {
		return;
	}

	$listing_author = (int) get_post_field(
		'post_author',
		$auction->listing_id
	);

	$transaction_id = self::create_transaction(
		array(
			'auction_id'  => $auction->id,
			'listing_id'  => $auction->listing_id,
			'seller_id'   => $listing_author,
			'buyer_id'    => $winner->bidder_id,
			'winning_bid' => $winner->bid_amount,
		)
	);

	if ( $transaction_id ) {

		Flipnzee_Activity_Log::log(
			'transaction_created',
			$auction->id,
			$winner->bidder_id,
			'Transaction ID: ' . $transaction_id
		);
	}
}

This method:

  • retrieves the auction,
  • identifies the seller,
  • creates a transaction,
  • logs the successful creation.

Step 4: Load the Transaction Manager

Open:

flipnzee-auctions.php

Near the bottom:

new Flipnzee_Shortcodes();

Add:

new Flipnzee_Transaction_Manager();

Result:

new Flipnzee_Shortcodes();
new Flipnzee_Transaction_Manager();

Without instantiating the class, WordPress would never register the action hook.


Step 5: Verify Syntax

Run:

php -l includes/class-bid-manager.php

Then:

php -l includes/class-transaction-manager.php

Both should report:

No syntax errors detected

Step 6: Test the Workflow

Create a test auction.

Place at least one bid.

Allow the auction to expire naturally.

After scheduled maintenance runs, verify:

Activity Log

You should see:

  • winner_determined
  • transaction_created

Transactions Table

A new row should appear inside:

wp_flipnzee_transactions

Example:

AuctionSellerBuyerStatus
3122pending

Event Flow

The plugin now follows this architecture:

Auction Ends
        │
        ▼
Bid Manager
Determines Winner
        │
        ▼
do_action(
    flipnzee_auction_winner_determined
)
        │
        ▼
Transaction Manager
        │
        ▼
Creates Transaction
        │
        ▼
Activity Log

Each component has a single responsibility.


Challenges Faced

During implementation, an important architectural refinement emerged.

Initially, the event hook was placed inside the Auction Manager. However, testing showed that winner determination actually occurs within the Bid Manager. Moving the hook to the correct location ensured that the event is fired exactly when the winning bid is known.

This adjustment resulted in a cleaner and more maintainable design.


Lessons Learned

Several important WordPress development concepts were reinforced:

  • WordPress hooks can be used to build event-driven systems.
  • Managers should communicate through actions rather than direct method calls.
  • Keeping responsibilities separated improves maintainability.
  • Activity logs provide valuable insight during debugging and verification.
  • Incremental testing after each change makes it easier to isolate and resolve issues.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Outcome

By the end of this lesson, the Flipnzee Auctions plugin automatically creates a transaction record whenever an auction successfully determines a winner. The transaction is stored in its own database table and recorded in the Activity Log, providing a reliable foundation for future features such as escrow integration, payment processing, seller confirmation, buyer confirmation, and ownership transfer.

This lesson marks an important architectural milestone, transitioning the plugin toward a scalable, event-driven design that will support the remaining stages of the auction lifecycle.