A reusable company comparison + “picked for you” experience built for WordPress using:
- Vanilla PHP (shortcodes + REST endpoint)
- Vanilla CSS (BEM naming, responsive table → mobile cards)
- Vanilla JavaScript (filters, URL state, modals, animations)
- Optional ACF usage (not required for core functionality)
This repo is structured as a git-friendly wrapper around the actual WordPress plugin.
plugin/company-compare/→ the installable WordPress plugin folderplugin/company-compare/assets/→ frontend CSS + JS
Use these in WordPress pages:
- Homepage form:
[cc_form] - Results page (e.g.
/picked-for-you):[cc_results] - Standalone contact form (optional):
[cc_contact_form]
GET /wp-json/cc/v1/companies
The plugin can return either:
- Fake data (built-in sample dataset) — default
- Real API (JSON) — configured via wp-admin
Go to: Settings → Company Compare
- Toggle Use fake data
- Set Real API URL
- View Live data preview (sanitized)
- Mark companies as Featured (boosted in ranking)
- Adjust Featured boost score
- In WordPress: Plugins → Add New → Upload Plugin
- Upload the ZIP containing
plugin/company-compare/ - Activate Company Compare
Copy plugin/company-compare/ into:
/wp-content/plugins/company-compare/
Then activate in WordPress.
- Set your Homepage to a page containing:
[cc_form] - Create a page at
/picked-for-youcontaining:[cc_results]
If a CTA link is missing or a placeholder (href="#"), the click will open the Contact modal instead.
This prevents dead CTAs even when a company lacks an on-demand intro link, review link, or website URL.
- CSS uses BEM class naming.
- Uses
prefers-reduced-motionfor animations. - Keeps server-rendered markup intact for SEO; JS enhances progressively.
Internal / assessment use.