=== EVC Metatag ===
Contributors: evcapps
Tags: seo, meta description, meta keywords, head cleanup, open graph, sitemap, xml sitemap, robots.txt, noindex
Requires at least: 5.8
Requires PHP: 7.4
Tested up to: 6.8
Stable tag: 1.12.0
License: Apache-2.0

Cleans up the WordPress <head>, puts SEO titles, descriptions and keywords on every page from a form, and serves a sitemap.xml — no functions.php editing, with hard character and word limits.

== Description ==

Thin pages are the URLs WordPress invents on its own: an attachment page for every
image, a tag archive, a dated archive, author archives, endless search results.
Each one can be no-indexed, or, for attachments, redirected to the page the image
belongs to. Then robots.txt is editable in place, with the sitemap line added for
you and a warning if the text would block the whole site.

The sitemap is built when a crawler asks for it, not on a schedule, so it cannot
be stale and cannot be left pointing at a deleted page. Every published page and
post goes in with its last-modified date; anything marked no-index is left out,
because telling a crawler "do not index this" and then listing it is a signal to
trust neither. Big sites are split at 2,000 URLs into a sitemap index
automatically, and robots.txt gains the Sitemap: line.


The <head> of a default WordPress site carries a lot of fingerprints, and every
page still needs its own title, description and keywords. Doing that properly
means hand-editing functions.php, or buying a heavy SEO suite.

EVC Metatag does the two jobs in one small plugin.

**1. Remove the WordPress clutter.** One checkbox per item: version generator
tag, RSD/EditURI, Windows Live Writer manifest, shortlink, adjacent-post links,
the emoji script, oEmbed discovery, the REST API link tag, and optionally the
block-editor CSS.

**2. Fill in the basics for every page.** EVC Metatag → Pages lists every page and
post with three fields:

* **SEO Title** — replaces the theme's <title> for that page
* **Meta Description** — printed as <meta name="description">
* **Keywords** — printed as <meta name="keywords">

Each field has a live counter and a hard cap (60 characters, 155 characters /
25 words, 8 terms by default, all adjustable). Anything longer is trimmed on
save and the notice tells you how many fields were cut. Short entries are what
search engines and social previews actually display.

**Auto-fill.** Every empty field has a suggestion taken from the page itself —
the first whole sentence for the description, its tags/categories and title
words for the keywords. Click *Auto-fill empty fields* to fill a whole screen
at once. Fields you already wrote are never overwritten.

**Social previews.** Open Graph and Twitter card tags are generated from the
same fields, with the featured image (or a default share image from Settings)
as the preview picture.

**3. Custom CSS, in the same place.** A box on the Custom CSS tab for the
stylesheet a theme's options page used to hold. It is printed in the <head>
after your theme's own CSS, so an override wins without !important on every
line. Nothing is minified or tidied: what you paste is what a visitor's browser
reads. A closing </style>, a <script> tag or a PHP opener is taken out on save
and you are told it was, and braces that do not balance are reported with the
count, because a rule that is never closed swallows every rule after it.

**4. The page title the theme prints.** WordPress does not print a page's
title above its content; the theme does, and on a page pasted in with its own
heading that is the same words twice. Head cleanup has three choices: leave it
alone, hide it only where the page already has its own heading (recommended), or
never print it. Only the theme's copy is touched, so the browser tab, the search
result title, menu labels and the admin lists are left alone. Each page can be
set either way on its own, in the Advanced columns on Pages & Posts.

**No speed cost.** No external API calls, no license server, nothing phones
home. Two options in your own database, deleted on uninstall.

== Installation ==

1. Plugins → Add New → Upload Plugin → choose `evc-metatag.zip` → Install.
2. Activate.
3. Open **EVC Metatag** in the admin menu, fill in the pages, Save.
4. Open **EVC Metatag → Settings** to adjust the limits or turn head cleanup items
   on and off.

== Frequently Asked Questions ==

= Does it replace my theme's title? =

Yes, when an SEO Title is set for that page. Pages without one keep the
theme's own title, so you can fill them in gradually.

= The theme prints my page title twice. Can it stop one? =

Yes. **Head cleanup → The page title** can hide the theme's copy only where the
page already has a heading of its own, on every page, or not at all. The heading
you wrote into the page is never touched, and neither is the browser tab or the
search result title. One page can be set against the rest of the site in the
Advanced columns on Pages & Posts.

= Will removing the emoji script break anything? =

No. It only stops WordPress loading its emoji replacement script, which most
sites never use.

= Block editor CSS — should I turn it on? =

Only on a site whose pages were not built with the block editor. It removes the
stylesheet WordPress loads for Gutenberg blocks, and pages built with blocks
will look wrong without it.

= Does the custom CSS override my theme? =

It is printed after the theme's stylesheets, so a selector of the same
specificity wins without !important. A theme rule marked !important still beats
a plain one, and a rule that only exists in the theme's own mobile stylesheet
may need the same media query. Nothing here replaces a child theme; it is for
the handful of rules an options page used to hold.

= Is the meta keywords tag still useful? =

Google ignores it. Bing and some smaller engines still read it, and it costs
nothing. Keep it short and truthful.

== Changelog ==

= 1.11.2 =
* No prices are printed anywhere: not on the banner, not on the Register screen, not in the
  manual, not in the readme. The price lives on the checkout page, so it can be changed once
  and every copy follows. Every button that used to read one still opens the same checkout.


= 1.11.1 =
* If a package arrives without includes/evc-metatag-engine.php, or with that file cut
  short, the plugin now says which file it is short of, how big the copy it can see is,
  what else is in the includes folder, what PHP said, and how to put it right. Before
  this it stopped on a blank screen and said nothing at all.
* Nothing you have written is lost when that happens: titles, descriptions, keywords
  and settings are stored in the database, not in that file.
* A file that stopped half way is caught and reported rather than fatal, and the plugin
  checks that the file which did load really registered itself.

= 1.11.0 =
* Two files now instead of one. The header, constants and licence stay in
  evc-metatag.php; the screens and the site-wide work moved to
  includes/evc-metatag-engine.php, which the licensed package ships as encoded files.
  Nothing changes on screen.

= 1.10.0 =
* The page title the theme prints, on the Head cleanup tab. WordPress does not print a page's
  title above its content; the theme does, and on a page pasted in with its own heading that is
  the same words twice. Three choices: leave it alone, hide it only where the page already has
  its own heading (recommended), or never print it. Only the theme's copy is touched - the
  browser tab, the search result title, menu labels and the admin lists are left alone.
* Each page can be set either way on its own, in the Advanced columns on Pages & Posts, so one
  page can keep its title while the rest lose theirs, and the other way round.
* Fixed while in there: clicking "Fill empty fields on this page" dropped the share image on
  every row it touched. The row is now updated rather than rebuilt.

= 1.9.1 =
* Copy and Download buttons under the Custom CSS box. Copy puts the stylesheet on the
  clipboard; Download saves it as site-custom.css with the date and site name in a comment
  at the top, which is what makes it portable to the next theme, or to a child theme.
* Both work on a free or lapsed copy as well: the box that holds your CSS is not locked
  when the licence is.

= 1.9.0 =
* A Custom CSS tab: one box for the stylesheet a theme's options page used to hold.
  It is printed in the <head> at the end, after the theme's own CSS, exactly as
  typed, so a rule can be changed without a child theme or another plugin. Off
  until the box is ticked, and part of the full version, because a stylesheet on
  every page is site-wide by definition.
* The box cannot break the page it sits in: a closing </style>, a <style>, a
  <script>, a <iframe>/<object>/<embed>, a PHP opener, a CDATA marker or an HTML
  comment marker is removed on save, and the screen says what was removed. Everything
  else is stored verbatim, quotes, brackets and !important included.
* Braces that do not balance are reported with the count and which way they are
  wrong, and an empty declaration or expression() is named, because a rule that is
  never closed silently swallows every rule after it.
* Saving now returns to the tab you saved from instead of always landing on Basics.

= 1.8.1 =
* Every second column on the Links screen carries a light fill, so a row of text can be
  followed across the table without losing your place. The page name in the first column
  stays plain, because that is the thing being looked for.

= 1.8.0 =
* A Links screen. It reads your published pages and posts and shows which pages nothing on your
  site links to, with the pages that should link to them beside each one (compared on the words in
  the titles, and it says so when it has no suggestion rather than inventing one). Pages carrying
  twelve or more links are flagged. It never edits a page.
* It then visits every address your pages point at and lists the broken ones, six at a time with a
  progress line, keeping the result with the date it was checked. Pages on your own site are
  checked without a request. A 404 is reported as broken; a refusal, a password prompt, a rate
  limit or a timeout is reported as "could not tell" with what happened, because none of those
  proves the link is wrong.
* Reading your own pages is free. Visiting the addresses your pages point at is part of the full
  copy: each one is a request to another server.

= 1.7.6 =
* The Manual button opens https://evcapps.ca/evc-download/metatag-manual/, so manual downloads
  are counted by the download tracker like every other EVC download, and the PDF can be replaced
  without a plugin release. A copy still ships inside the plugin.

= 1.7.5 =
* Attachments are out of Pages & Posts. A zip in the Media Library was listed as if it were a
  page asking for a description; the sitemap had always excluded attachments, so the list now
  agrees with it, and the Settings box that caused it is gone.

= 1.7.4 =
* The top of Pages & Posts is three rows instead of four paragraphs and two buttons that both
  said "fill". The limits are stated once, the site check is a sentence rather than three
  counters reading 0, and saving and filling sit in one bar above the table.
* "Fill every empty field on the site" was a second form in the middle of the screen; it is a
  link beside Save now, and reads as the same job at a larger size.

= 1.7.3 =
* The manual ships inside the plugin and is linked from every screen and from the Plugins
  row, so it cannot be a link to a file that was never uploaded.
* The version shown on the screens is read from the plugin header. It was typed twice and
  the screen said 1.7.0 for two releases.

= 1.7.2 =
* The sitemap address is on the screen, in a box, with Copy address next to it, and buttons
  that open Google Search Console and Bing Webmaster Tools. Switching a sitemap on and then
  leaving someone to type the address out of a browser tab was a job stopped one step short.
* The store item the Buy button opens is no longer a setting. It is compiled in, and an id
  left behind by the old field is ignored.

= 1.7.0 =
* Free and full. Everything that writes a tag onto a single page is free: titles,
  descriptions, keywords, share images, the social and canonical tags, structured data,
  auto-fill and the head cleanup. The site-wide work is the paid part, bought once:
  the Google and Bing verification codes, sitemap.xml, llms.txt, robots.txt, the no-index
  switches for the pages WordPress invents, and the audit that counts the pages with no
  description and the ones competing for the same result.
* One row of tabs across the top of every screen, the same row WordPress uses on its own
  settings pages: Pages & Posts, Basics, Business details, Search engines, WordPress pages,
  robots.txt, Head cleanup, Register. Click a tab, the screen changes; no menu hunting and
  no JavaScript. The Register tab is the first thing you see when you want to enter a key. The Pages table shows three columns at a time (Words, Sharing,
  Advanced) rather than seven squeezed.
* Both verification fields now link to Google Search Console and Bing Webmaster Tools, so
  the code can be found without being told where to look.
* A strip at the top of both screens while the site is unregistered: what is held back,
  what it costs, and a Buy button. It disappears the moment a key is entered.
* The buy link takes the product id from the Register screen (`?product_id=`), so it
  opens that item at the checkout instead of the whole store.
* Removed the developer's name from the plugin header. It is an EVC Apps product; the
  author is the company.
* Tests: 274 assertions, including the free tier's own section.

= 1.6.0 =
* Large image previews. Indexable pages now ask Google for `max-image-preview: large`,
  which is what decides whether the result gets a full-width picture or a thumbnail the
  size of a postage stamp. Pages marked no-index are untouched.
* Google Search Console and Bing Webmaster verification codes in Settings. Both accept a
  meta tag as proof the site is yours, and without it the reports that show which words
  your pages are found for stay closed. Printed on the home page, which is where they are
  looked for.
* Duplicate warnings. The Pages screen now counts the pages with no description, the pages
  sharing a title and the pages sharing a description, and names the culprit in each row.
  Two pages saying the same thing compete for one result, and the search engine shows
  whichever it trusts and ignores the other. Compared on the words, not the capitals or
  the spacing.
* Share cards now state the picture's width and height, so Facebook, LinkedIn and X reserve
  the right space instead of reflowing the card. X also gets the picture itself, because it
  does not read Open Graph.

= 1.5.1 =
* The hide box keeps its column. The seven column widths added up to 109%, so the table
  overflowed its container and the overflow landed on the narrowest column, which is the
  last one: the no-index tick. With a long slug or a wide page-type dropdown it was covered
  by the column before it.
* The table now uses table-layout: fixed, every column declares a width, the widths add up
  to 100, the dropdowns are told to fit their cell like the text boxes already were, and the
  hide box has its own cell with the tick and its word kept on one line.
* The harness checks the sum now, so a column width added later cannot quietly push it over
  again.

= 1.5.0 =
* The structured data no longer assumes one kind of site. Settings gains a choice of
  organisation type (company, local business, online store, professional service, a
  single person, or none at all), a separate logo URL, a telephone and a postal address.
  Nothing is invented: an empty address is left out, and leaving the type on "none"
  omits the organisation entirely while still describing the site.
* A Page type column on the Pages screen. Any page can declare itself an FAQ page, a
  how-to, a service, a product or an article without writing code. "Automatic" keeps the
  previous behaviour, and the evc_metatag_schema_type filter still wins for anything else.
* The site's own description is stated even when the organisation is switched off.

= 1.4.0 =
* llms.txt, served at /llms.txt. A plain summary of the site and its pages, in the
  shape the answer engines read: a title, one line saying what the site is, an optional
  note, then the pages and posts grouped with the wording already written for them on
  the pages screen. Pages marked no-index are left out, so this file and the sitemap
  never contradict each other.
* Two new settings: a switch for llms.txt, and a box for anything an answer engine
  should know first.
* Built on the request rather than stored, so it is never stale, and it works on plain
  permalinks as well as pretty ones.

= 1.3.0 =
* Structured data (JSON-LD) on every page. The home page states the organisation, its
  logo and its social profiles, and the site itself with its search action. Every other
  page states what it is, where it sits, and the trail back to the home page. Posts carry
  their published and modified dates; products carry price, currency and stock state.
* Two new settings: a switch for structured data, and a box for social profile URLs,
  one per line.
* A filter, evc_metatag_schema_type, so a page can declare itself a Service, an FAQPage
  or anything else schema.org knows.
* A filter, evc_metatag_schema_graph, to add or change statements before they are printed.

= 1.2.2 =
* WordPress's own /wp-sitemap.xml can be switched off, so the site publishes one
  list instead of two. A second list cannot honour the no-index switches and
  splits what crawlers are told. On by default while this plugin's sitemap is on.

= 1.2.1 =
* The share image box no longer spills into the No-index column. It was a URL
  field the browser drew at its default width; it is now a Choose button that
  opens the media library and shows the file name, and every control in the
  table is explicitly told to fit its own cell.
* Column widths now add up to 100%.

= 1.2.0 =
* Thin pages: attachment pages redirect to their parent, tag/date/author archives
  and search results can be no-indexed, one checkbox each.
* Editable robots.txt, off by default, with markup stripped on save, a warning
  when the text blocks the whole site, and the sitemap line added automatically.
  A site set to discourage search engines still gets WordPress's block.
* A share image per page, ahead of the featured image and the site default.
* Fill every empty field on the site in one click, and a "Missing only" filter.
* Tests: 150 assertions.

= 1.1.0 =
* sitemap.xml, generated on request: every published page and post, last-modified
  dates, no-index pages excluded, automatic index past 2,000 URLs, robots.txt
  line, on/off in Settings.
* Deactivation removes the rewrite rules the sitemap added.



= 1.0.0 =
* First release. Head cleanup with per-item checkboxes, per-page SEO title /
  description / keywords form with hard limits and counters, auto-fill from page
  content, Open Graph and Twitter tags, canonical link, per-page no-index.
