Sol.College

Full lesson

solana-pay-wordpress

What it does

From the project README:

https://github.com/sidwyn/solana-pay-wordpress/assets/103864/cd0a420e-3a11-4f68-a115-8475d2cbc107
Original
sidwyn/solana-pay-wordpress
SuperStack fork
Blockchains/solana-pay-wordpress @ fd02c2a
Stars
2
Last push (original)
2024-04-14
Languages
PHP, TypeScript, JavaScript, CSS
Detected stack
Solana Payweb3.js
Categories
Payments
Licence
Apache-2.0

Architecture

6 source files. By extension: .tsx ×4, .js ×2.

Top-level directorySource files
core4
(root)2

🟡 Builds, verified 2026-11-02 Tested on 2026-11-02: full log results.json

Build it yourself: step-by-step guide

Every command below was run on 2026-11-02 by tests/run_fork.py against the pinned commit, and the results come from that run. The full output is in the committed log.

1. Prerequisites (versions we tested with)

2. Clone at the tested commit

git clone https://github.com/Blockchains/solana-pay-wordpress.git && cd solana-pay-wordpress
git checkout fd02c2ab79d2d18f82f3538ad257eae399564c66

3. Configure

No environment file is needed.

Fixes we had to apply to the pinned commit before it would build or run, with the reason for each:

  1. npm pkg set devDependencies.typescript=^5. the build calls tsc but typescript is not declared

4. Install dependencies

DirectoryCommandResultTime
.npm install --no-audit --no-fund --legacy-peer-deps✅ pass14s

5. Build

DirectoryCommandResultTime
.npm run build✅ pass7s

7. Deploy to a local validator

Notes: Running the plugin needs WordPress + WooCommerce + PHP; only the JS bundle is built and tested here.

Extend it

  1. Add an integration test that runs the main flow end to end and asserts every account state change.
  2. Add a negative test: call each instruction with the wrong signer or account and check that it fails.
  3. Make the frontend read the cluster from an env var, deploy it to GitHub Pages and point it at your devnet program.
  4. Wire the build into CI by copying this site's verify-forks workflow.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

sidwyn/solana-pay-wordpress · core/includes/assets/js/solana-pay-button.tsx L49–72 @ fd02c2a · Apache-2.0 · original
    }     const payAddress = process.env.SHOP_SOL_ADDRESS;    if (payAddress == null || payAddress.length === 0) {      alert("Payer address not found. Please define it in your .env file.");    }     setHasErrorMessage(null);    const lamports = await connection.getMinimumBalanceForRentExemption(0);     const transaction = new Transaction().add(      SystemProgram.transfer({        fromPubkey: publicKey,        toPubkey: new PublicKey(payAddress),        lamports: payAmount * LAMPORTS_PER_SOL ?? lamports,      })    );     const {      context: { slot: minContextSlot },      value: { blockhash, lastValidBlockHeight },    } = await connection.getLatestBlockhashAndContext();     const signature = await sendTransaction(transaction, connection, {
  1. Line 70 } = await connection.getLatestBlockhashAndContext();: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 72 const signature = await sendTransaction(transaction, connection, {: Submits the signed transaction to the cluster.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run buildwebpack --mode production

What you could build from it