WP Manifestindependent plugin directory
manifest / social / social-preflight

Social Preflight

Check how any page looks when shared on Facebook, LinkedIn, X and WhatsApp. Reads what your site actually publishes, with any theme, builder or SEO plugin.

by Matteo Cardini · github.com/matteocardini/social-preflight · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/matteocardini/social-preflight/archive/refs/heads/main.zip

See what Facebook, LinkedIn, X and WhatsApp will show for a page, before anyone shares it.

A WordPress plugin that reads the published page the way a social network does, renders the four previews side by side, and lists what to fix.

Not another Open Graph plugin

Most social plugins write the tags for you. This one reads what your site already publishes and tells you what is wrong with it. It sits happily next to Yoast, Rank Math, SureRank or a theme that prints its own tags, and it is the only way to see what all of them together actually produced.

Why

A link shared without an image is a link nobody clicks, and you only find out after you have sent it. Most social preview tools live inside one SEO plugin or one editor. This one reads the final HTML of the page, so it works with the block editor, the classic editor, Bricks, Elementor, Divi, a custom theme, Yoast, Rank Math, or no SEO plugin at all.

Where it shows up

  • Admin bar, on the front end and on every edit screen, which is what makes it work inside page builders.
  • Editor sidebar, as a panel on any public post type.
  • Tools → Social previews, a table that checks the latest published content in one pass.

What it checks

Check Level
Preview image missing Blocking
Preview image with a relative path Blocking
Title missing Blocking
Title longer than 60 characters Warning
Description missing, too short or too long Warning
Description inherited from the meta description Warning
Twitter card missing Warning
Tags printed twice (theme plus SEO plugin), with the tag names Warning
Preview image served over http Warning
Preview image with no alt text Notice
Site name repeated at the end of the title Notice

Install

Download the latest release, then upload the zip in Plugins → Add new → Upload plugin. Or clone the repository into wp-content/plugins/.

How it works

wp_remote_get fetches the permalink, Social_Preflight_Parser pulls the tags out of <head>, and Social_Preflight_Analyzer turns them into a short list of problems. Both classes are plain PHP with no WordPress calls, so they run in the test suite without a WordPress install. Results are cached for five minutes; "Check again" bypasses the cache.

How the interface is built

The panel is a small React app written in JSX and built with esbuild into a single 5 kB file. It uses the React that WordPress already loads (wp.element), plus wp.apiFetch and wp.i18n, so the plugin ships no framework of its own.

npm install
npm run build   # src/index.jsx -> assets/preview.js
npm run dev     # same, watching and unminified

The built file is committed, so the plugin works straight from a clone with no build step.

Releasing

npm run dist   # builds assets and writes social-preflight.zip without the development files

The zip contains only what a site needs: plugin files, assets/, includes/, src/ and readme.txt. Tests, workflows and build config stay in the repository.

Development

php tests/run-tests.php   # 21 tests, no PHPUnit or Composer needed
find . -name '*.php' -print0 | xargs -0 -n1 php -l

Roadmap

  • [ ] Check the image dimensions against each platform's minimum
  • [ ] Warn when the preview image is the site logo on every page
  • [ ] Scan the whole site, not just the latest 25 items
  • [ ] Editable preview: try a different title and see the result live

License

GPL-2.0-or-later