Skip to content

Claude/wordpress open data wizard mm oel#7

Merged
daimpad merged 5 commits intomainfrom
claude/wordpress-open-data-wizard-MmOEL
Apr 22, 2026
Merged

Claude/wordpress open data wizard mm oel#7
daimpad merged 5 commits intomainfrom
claude/wordpress-open-data-wizard-MmOEL

Conversation

@daimpad
Copy link
Copy Markdown
Owner

@daimpad daimpad commented Apr 22, 2026

No description provided.

claude added 5 commits April 21, 2026 21:39
CHANGELOG.md:
  - Add v1.8.0 entry (wp.media meta box, auto file meta, security)

README.md:
  - Wizard description: 4 tabs → 5 tabs + sidebar meta box
  - Add sections: Download-Datei (wp.media), Einstellungsseite,
    Qualitätsindikatoren, Download-Card Shortcode
  - Dateistruktur: complete rewrite to match v1.8.0 file layout
    (all new includes/, assets/js/, assets/css/, tests/ files listed)
  - Feldmapping: split into tabs; add all v1.7.0 fields (landingPage,
    accrualPeriodicity, spatial, temporal, contactPoint) and
    sidebar meta keys (_odw_file_id, _odw_file_size, _odw_file_format)
  - REST API @context example: add vcard, skos, xsd, odw namespaces;
    show qualityScore and contactPoint in sample response
  - Abhängigkeiten: expand table to include dev dependencies
  - Roadmap: remove implemented items (Qualitätsindikatoren,
    Automatische Metadatenextraktion); add Gutenberg block
  - Deinstallation: fix outdated option key reference; describe
    Settings-page checkbox and what uninstall.php deletes

open-data-wizard.php: bump Version + ODW_VERSION constant to 1.8.0

PHP docblocks:
  - class-admin.php: expand file docblock to list all responsibilities
  - class-fields.php: add @return docblocks to get_license_options(),
    get_theme_options(), get_periodicity_options(), get_format_options()
  - class-post-types.php: add docblocks to init() and register()
  - class-shortcode.php: expand file docblock (stored meta pattern,
    lazy CSS); add @param/@return to format_bytes()

JavaScript:
  - odw-file-upload.js: add JSDoc @param to _setHasFile() and
    description to _setEmpty()

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
…tibility

Root cause: composer.lock was generated on PHP 8.4.19, which allowed
Composer to resolve doctrine/instantiator 2.1.0 (requires ^8.4).
CI runs PHPUnit on PHP 8.1, 8.2 and 8.3, so composer install would
fail with a platform requirement mismatch.

Fix:
- Add config.platform.php = "8.1.0" to composer.json so Composer
  always resolves transitive deps against the declared minimum PHP
- Run composer update doctrine/instantiator --with-dependencies
  → downgrades to 2.0.0 (requires ^8.1, satisfies phpunit constraint
  "^1.5.0 || ^2")

Dependency chain: phpunit/phpunit → doctrine/instantiator: "^1.5.0 || ^2"

All 56 PHPUnit tests pass on current PHP 8.4.19 after the downgrade.

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
- Add phpcs.xml config to exclude impractical sniffs (file naming,
  slow query warnings, serialize in REST API)
- Add missing class/method/function docblocks with @param/@return tags
  across all includes/ and tests/ files
- Fix inline comments: end with full stop, capitalize short descriptions
- Rename variables conflicting with WordPress globals ($role, $posts,
  $post_id) in uninstall.php to $odw_* prefix
- Fix short ternary (?:) usage and Yoda conditions in class-shortcode.php
  and class-admin.php
- Replace unlink() with wp_delete_file() in class-setup.php
- Use absint()/sanitize_text_field() consistently for input handling
- Fix phpcs:ignore placement in class-fields.php (moved to phpcs:disable
  block so docblock stays associated with companion function)
- Consolidate nonce-verification phpcs:ignore in class-validation.php

All 56 PHPUnit tests pass; PHPCS reports zero violations.

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
New endpoint: GET /wp-json/datenatlas/v1/delta?since=<ISO8601>

- Returns datasets modified after the given timestamp (paginated) in
  dcat:dataset, and tombstone entries for trashed datasets in odw:removed.
- Accepts YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS, YYYY-MM-DDTHH:MM:SSZ, and
  offset-notation datetimes via validate_since_param() / parse_iso8601().
- Compares against post_modified_gmt (UTC) to avoid timezone drift.
- Caches responses as odw_delta_* transients (same 5 min TTL as catalog);
  cache is invalidated on save_post_odw_dataset and trashed_post together
  with the existing catalog transients.
- Response headers: X-ODW-Delta-Since (echoed), X-ODW-Generated-At
  (use as next ?since value), X-ODW-Cache, X-WP-Total, X-WP-TotalPages.
- 13 new PHPUnit tests in tests/test-rest-delta.php (69 total, all pass).
- PHPCS: zero violations (added Generic.Files.OneObjectStructurePerFile
  exclusion for tests/* to allow multi-class stub file).

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
access_url (1.2):
- Run all distribution access_url values through esc_url_raw() in the
  JSON-LD builder before including them in the output; esc_url_raw()
  strips javascript:, data:, and any other non-HTTP(S)/FTP scheme and
  returns an empty string, causing the distribution to be skipped.
  Validation already blocks publishing without a valid URL; this adds a
  defence-in-depth layer at the data-output stage.

Capability access control (3.1):
- Change capability_type from 'post' to 'odw_dataset' with map_meta_cap
  and an explicit capabilities array that maps every write capability
  (create, edit, delete, publish) to 'manage_open_data'.
- 'manage_open_data' is already granted to administrator and editor roles
  on plugin activation (open-data-wizard.php), so the effective access
  policy is: admins/editors can manage datasets, all other roles cannot.
- read_post maps to 'read' so any logged-in user can preview via the
  admin but cannot modify.

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
@daimpad daimpad merged commit ee82d6a into main Apr 22, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants