Skip to content

Claude/wordpress open data wizard mm oel#6

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

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

Conversation

@daimpad
Copy link
Copy Markdown
Owner

@daimpad daimpad commented Apr 21, 2026

No description provided.

claude added 5 commits April 21, 2026 16:01
…ion)

Neue Admin-Seite unter Datensätze → Einstellungen mit vier Sektionen.
Standardwerte werden via set_default_value() direkt in Carbon Fields
vorausgefüllt; Cache-TTL ist nun konfigurierbar statt hardcodiert (300 s).

- class-settings.php: WordPress Settings API; ODW_Settings::get() als
  zentrale Zugriffs-API; filter_catalog_title() koppelt odw_catalog_title
  an gespeicherten Wert; handle_recalculate_quality() iteriert alle
  Datensätze und ruft ODW_Quality::calculate/store auf
- class-fields.php: set_default_value() für odw_publisher, odw_license,
  odw_language liest aus ODW_Settings::get()
- class-rest-api.php: delete_catalog_transients_public() als öffentlicher
  Alias — wird nach Einstellungsänderungen aufgerufen
- uninstall.php: liest odw_settings[delete_on_uninstall]; löscht alle
  Plugin-Optionen (odw_settings, odw_demo_post_id, odw_show_welcome)
- open-data-wizard.php: class-settings.php vor class-fields.php laden

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
8 neue DCAT-AP 3.0 Felder in neuem Tab 4 (Vorschau → Tab 5 verschoben).
JSON-LD Context um vcard und skos Namespaces erweitert.

- class-fields.php: Tab "4 — Erweiterte Angaben" mit Projektseite
  (dcat:landingPage), Aktualisierungsfrequenz (dct:accrualPeriodicity,
  EU Publications Office Vokabular), geographischer Abdeckung
  (dct:spatial → skos:prefLabel), zeitlichem Bezug (dct:PeriodOfTime
  mit dcat:startDate/endDate) und Kontaktpunkt (vcard:Organization
  mit vcard:fn, vcard:hasEmail, vcard:hasURL);
  get_periodicity_options() für EU-Frequenz-Vokabular;
  odw_build_dataset_jsonld() um alle neuen Felder erweitert
- class-rest-api.php: vcard + skos Namespace in JSONLD_CONTEXT
- class-admin.php: Help Tab Text auf Tab 5 (Vorschau) aktualisiert

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
… tests)

- tests/test-settings.php: 7 tests covering ODW_Settings::get() defaults, merging,
  single-key access and filter_catalog_title() with whitespace handling
- tests/test-quality.php: 17 tests covering get_level() thresholds, get_level_label(),
  get_indicators() total (100 pts), get()/store() meta round-trip, append_to_jsonld()
- tests/test-shortcode.php: 10 tests covering format_bytes() byte/KB/MB/GB ranges
  and render() early-return edge cases (zero ID, missing post, wrong type, non-published)
- tests/test-fields-extended.php: 22 tests covering get_periodicity_options() EU URIs
  and odw_build_dataset_jsonld() for all v1.7.0 fields (landingPage, accrualPeriodicity,
  spatial, temporal start/end, contactPoint with mailto: prefix and @id URL)
- composer.json: downgraded phpunit to ^9.6 and wp_mock to ^1.0 (PHP 8.4 compat)
- phpunit.xml: migrated from PHPUnit 10 schema; added suffix=".php" for test discovery
- vendor: added PHPUnit 9.6, WP_Mock 1.1, Mockery and related dev dependencies

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
…d file meta

Replaces the Carbon Fields file field with a custom sidebar meta box that uses
the native WordPress Media Library (wp.media) for a richer upload experience.

Changes:
- includes/class-fields.php: remove CF Field::make('file', 'odw_file_id') from Tab 3
- includes/class-admin.php:
  - register_file_meta_box() — sidebar meta box on odw_dataset edit screen
  - render_file_meta_box() — button + file preview area + remove button + nonce
  - save_file_attachment() — nonce/capability-gated save; auto-computes
    _odw_file_size (bytes) and _odw_file_format (uppercase extension) on file change
  - enqueue_assets() — calls wp_enqueue_media() and loads odw-file-upload.js
    with wp_localize_script (current file name + translated labels)
- assets/js/odw-file-upload.js (new) — jQuery + wp.media integration:
  opens media frame, writes attachment ID to hidden input, updates preview;
  remove button clears selection; UI state restored from localized PHP data
- includes/class-shortcode.php — reads pre-computed _odw_file_size/_odw_file_format
  from post meta; falls back to runtime filesize()/pathinfo() for old entries
- assets/css/admin.css — .odw-file-preview, .odw-file-actions, icon styles

Security: wp_verify_nonce + current_user_can('edit_post') in save handler.
All 56 PHPUnit tests pass.

https://claude.ai/code/session_013ma6QYffgnE2eKgDfh1Qgn
@daimpad daimpad merged commit e33ef61 into main Apr 21, 2026
0 of 10 checks passed
@daimpad daimpad deleted the claude/wordpress-open-data-wizard-MmOEL branch April 21, 2026 21:35
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