Skip to content

pbpyrojust/company-compare-wordpress-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Company Compare (WordPress)

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.

Repo structure

  • plugin/company-compare/ → the installable WordPress plugin folder
  • plugin/company-compare/assets/ → frontend CSS + JS

What the plugin provides

Shortcodes

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]

REST API endpoint

  • 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

Admin controls

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

Install

Option A — Upload ZIP

  1. In WordPress: Plugins → Add New → Upload Plugin
  2. Upload the ZIP containing plugin/company-compare/
  3. Activate Company Compare

Option B — Copy folder

Copy plugin/company-compare/ into: /wp-content/plugins/company-compare/

Then activate in WordPress.

Usage (recommended pages)

  1. Set your Homepage to a page containing: [cc_form]
  2. Create a page at /picked-for-you containing: [cc_results]

CTA fallback behavior

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.

Development notes

  • CSS uses BEM class naming.
  • Uses prefers-reduced-motion for animations.
  • Keeps server-rendered markup intact for SEO; JS enhances progressively.

License

Internal / assessment use.

About

A WordPress plugin for displaying JSON or API realtor results and filtering them.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors