Closes the three problems that blocked the consolidation and records the rest
as tasks.
Licence: GPLv2 or later (WordPress.org compatible)
LICENSE is now the full GPLv2 text and NOTICE is gone (it was Apache
specific). All 101 SPDX headers read GPL-2.0-or-later and every shipped
header says "GPLv2 or later".
This also fixes an inconsistency that predated the consolidation: the theme's
style.css declared GPLv2 while its PHP files carried Apache headers.
Old/ and archive/pre-umbra-releases/ keep their original Apache headers on
purpose -- they are frozen snapshots, not shipped code.
Schema: the catalogue schema is canonical for bd_books and bd_series
Adds Umbra_Schema_Migration. The catalogue and library modules previously
both created those two tables with different columns, so whichever plugin
activated first won and the other read and wrote against the wrong shape.
The migration detects a library-shaped table, RENAMES it aside (never drops
it), creates the canonical table and copies rows across:
- book IDs preserved, keeping bd_book_meta, bd_reviews, bd_ratings and
bd_review_shortlinks valid
- title/slug/description resolved from the linked post
- the library's single isbn/asin land on the ebook columns; amazon_asin is
also set so existing product links keep working
- series migrated first so books.series_id still resolves
- post linkage rewritten as _bd_bookshelf_book_id (preserved meta key)
- publish_date kept as _bd_bookshelf_publish_date (no catalogue column)
- bd_ratings goodreads/amazon folded into rating_goodreads/rating_amazon
- rows whose post is gone are skipped with a log line, not turned into
unusable books
- duplicate slugs de-duplicated, since catalogue slug is UNIQUE
It runs before dbDelta, and on admin_init as well as activation, because
plugin updates do not re-run activation hooks. Ordering matters: dbDelta adds
columns but never drops them, so pointed at a library-shaped table it would
graft on catalogue columns and leave a table satisfying neither schema.
Umbra_Bookshelf_Helper_Install no longer creates bd_books or bd_series.
Scraping: Goodreads only, one implementation
There were three Goodreads implementations and two Amazon ones; both library
"scrapers" were empty stubs attached to cron events that fired on schedule to
do nothing, and both real scraper classes were never called at all.
Umbra_Amazon_Scraper is deleted and the duplicate HTML parsing is gone from
Umbra_Rating_Sync, which now delegates to Umbra_Goodreads_Scraper. The two
library stubs and their cron registrations are removed. One schedule
survives: bd_bookshelf_sync_ratings, every 12 hours.
The rating_amazon column is retained (it holds data and is populated during
migration) and Amazon retail links are unaffected.
A new rating fetch failure keeps the last known value instead of writing zero.
The admin ratings notice no longer warns about Amazon scraping.
Umbra_SEO is now instantiated
It registers its hooks from a constructor and the bootstrap never constructed
it, so the class was dead code and no SEO output was produced. Its meta, Open
Graph, Twitter card and sitemap hooks now attach. Completing SEO for generated
book detail pages is docs/TASKS.md #2.
Assets that 404'd
- assets/images/default-cover.png now holds a real 512x815 cover
(WorkingTitleCover_512x815.png). The helper returned this path but the
repository contained no images at all.
- email/assets/js/admin.js is committed as an empty placeholder. It was
enqueued on every email admin page but had never been committed.
Tests
- tests/schema_migration_test.php: 42 checks against a real database, driven
through the sqlite3 CLI on a throwaway file. Covers shape detection, row
mapping, ID preservation, orphan handling, rating folding, idempotency and
slug collisions.
- tests/run_all.sh runs every suite.
- The declared version is now checked against the plugin header rather than a
literal, so a version bump cannot silently break the suite.
Docs
- KNOWN-ISSUES.md rewritten: three resolved, three remaining.
- TASKS.md added: email admin behaviour, book detail page SEO, batching the
rating sync, reclaiming legacy tables, reconciling the two book models,
retiring the Old/ archive.
- SPEC and ARCHITECTURE updated for schema ownership, the migration ordering
constraint, and the single scraper.
Version 1.1.0.
104 lines
4.8 KiB
Plaintext
104 lines
4.8 KiB
Plaintext
=== Umbra Bookshelf ===
|
|
Contributors: umbratools
|
|
Tags: books, series, isbn, authors, newsletter, publishing
|
|
Requires at least: 6.0
|
|
Tested up to: 6.6
|
|
Requires PHP: 7.4
|
|
Stable tag: 1.1.0
|
|
License: GPLv2 or later
|
|
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
Complete book management for authors and publishers: catalogue and ISBN tracking, series, pen names, retail links, rating sync, GDPR consent, and newsletter delivery.
|
|
|
|
== Description ==
|
|
|
|
Umbra Bookshelf is a single plugin covering the full book workflow. It
|
|
consolidates three previously separate plugins:
|
|
|
|
* **Books** (formerly BD Bookshelf) — the catalogue: ISBN/ASIN variants,
|
|
author records, series, retail sites and per-format buy links, Goodreads and
|
|
Amazon rating synchronisation, SEO rows, shortlink click tracking, GDPR
|
|
consent banners, and CSV/post import.
|
|
* **Library** (formerly BD BookShelfHelper) — the WordPress-native model: the
|
|
`book` post type and `series` taxonomy, pen names, a focused data-entry
|
|
screen, shortlinks, reviews and ratings, plus a migration screen.
|
|
* **Email** (formerly BD SimpleEmail) — newsletter delivery: subscribers and
|
|
newsletters, a `[bdm_signup]` shortcode, signup and unsubscribe handling via
|
|
AJAX and `admin_post`, Gemini-assisted composition, and Gmail/SMTP sending.
|
|
|
|
Everything now sits under a single **Umbra Bookshelf** admin menu.
|
|
|
|
= Upgrading from the old plugins =
|
|
|
|
Umbra Bookshelf reads and writes the same database tables, option keys, post
|
|
meta, cron hooks and shortcodes as the three plugins it replaces. Install Umbra
|
|
Bookshelf, then deactivate BD Bookshelf, BD BookShelfHelper and BD SimpleEmail.
|
|
**Do not delete** them from the Plugins page first — deleting runs their
|
|
uninstall routines, which drop your tables and options.
|
|
|
|
If you ran BD BookShelfHelper, the first page load after upgrading reconciles
|
|
your database automatically. The old table layout is kept aside as
|
|
`wp_bd_books_legacy_library` and `wp_bd_series_legacy_library` so nothing is
|
|
lost; you can drop those once you are satisfied the migration went well.
|
|
|
|
The shortcodes `[bd-book]`, `[bd-books]` and `[bdm_signup]` are unchanged, so
|
|
existing posts keep working. The admin menu locations have changed: see the
|
|
specification in `spec/SPEC_Umbra_Bookshelf_Plugin.md` for the full menu map.
|
|
|
|
== Frequently Asked Questions ==
|
|
|
|
= Do I need to migrate my books? =
|
|
|
|
Usually no. Table names, option keys, post meta keys and shortcodes are
|
|
deliberately unchanged; deactivate the old plugins rather than deleting them.
|
|
The one exception is a site that ran BD BookShelfHelper: its `bd_books` and
|
|
`bd_series` tables had a different layout, and those are reconciled
|
|
automatically on upgrade, with the originals kept aside.
|
|
|
|
= The admin menu looks different. =
|
|
|
|
It is one menu now instead of three. The catalogue, library and email screens
|
|
are all still present as submenus, and Settings is split into catalogue
|
|
settings and library settings.
|
|
|
|
= Where do ratings come from? =
|
|
|
|
Goodreads, refreshed every 12 hours. Amazon ratings are not scraped. Amazon
|
|
retail *links* still work as normal.
|
|
|
|
= Are there known problems? =
|
|
|
|
Yes — see `docs/KNOWN-ISSUES.md`, which is included with the plugin.
|
|
|
|
== Changelog ==
|
|
|
|
= 1.1.0 =
|
|
* Relicensed to GPLv2 or later for WordPress.org compatibility. The plugin
|
|
headers previously said GPLv2 while the licence files said Apache-2.0.
|
|
* The catalogue schema is now canonical for `bd_books` and `bd_series`. A site
|
|
that ran BD BookShelfHelper is reconciled automatically, preserving book IDs,
|
|
ratings and post links; the old tables are kept aside rather than dropped.
|
|
* Goodreads is now the only rating source, with a single implementation and one
|
|
12-hour cron event. Duplicated Amazon rating scraping removed.
|
|
* `Umbra_SEO` is now active, emitting meta, Open Graph, Twitter card and sitemap
|
|
data for book detail pages.
|
|
* Fixed a missing default cover image and a missing email admin script, both of
|
|
which caused 404s.
|
|
* Admin settings screen for ratings now notes that Goodreads is the only source.
|
|
|
|
= 1.0.0 =
|
|
* Initial release of the consolidated plugin.
|
|
* Merged BD Bookshelf, BD BookShelfHelper and BD SimpleEmail into one plugin
|
|
under a single admin menu.
|
|
* Renamed plugin headers, text domains, classes, constants, asset handles and
|
|
admin slugs to the Umbra Bookshelf identity.
|
|
* Preserved all database tables, option keys, post meta, cron hooks, nonces and
|
|
shortcodes, so existing installs need no migration.
|
|
* Registered the top-level admin menu once instead of three times.
|
|
* Fixed a duplicate-class fatal error between the catalogue's theme-compatibility
|
|
shim and the library module's helper class.
|
|
* Fixed duplicate AJAX handler, duplicate Settings submenu, and colliding asset
|
|
handles across modules.
|
|
* Added `spec/SPEC_Umbra_Bookshelf_Plugin.md`, `docs/KNOWN-ISSUES.md`,
|
|
`docs/ARCHITECTURE.md`, and the `tests/` verification suite.
|