=== maca Njuvs ===
Contributors: macas
Donate link: https://maca.se/donation/
Tags: news, events, calendar, information, restaurant
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.57
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

News and events with Gutenberg blocks, iCal feed, social sharing, and optional AI drafts (WordPress 7+).

== Description ==

**maca Njuvs** is a standalone WordPress plugin for news and events with its own database tables and settings.

* News with scheduled publishing, banner/ticker, popup, and in-page layouts for tables and columns
* Events with recurring dates and exceptions
* Gutenberg blocks for news and events (`maca-njuvs/maca-info-news`, `maca-njuvs/maca-info-events`)
* iCal feed at `/maca-njuvs-events.ics`
* Optional publishing to Facebook and Instagram via your own Meta app
* AI news suggestions via WordPress Connectors (drafts for review; requires WordPress 7.0+)

Shortcodes: `[maca_njuvs_news]`, `[maca_njuvs_events]`, `[maca_njuvs_calendar_subscribe]`

Plugin page: https://maca.se/maca-njuvs/

Source code: https://github.com/maca59/maca-njuvs

**Privacy:** On activation, deactivation, and uninstall, the plugin sends your site URL, plugin version, WordPress version, PHP version, and locale to Maca at `https://api.maca.se/v1/njuvs/events.php` so we can improve the plugin and count active installations. If you choose to send deactivation feedback, your selected reason and optional comment are included. No news, events, social tokens, or visitor data are transmitted.

Before first use, a site administrator must accept the plugin terms of use and privacy policy in the maca Njuvs admin screen.

== External services ==

This plugin optionally connects to Meta (Facebook) services when a site administrator configures social media publishing. No data is sent unless that feature is enabled and used.

= Meta Graph API =

Used to publish news posts to a connected Facebook Page and Instagram account, and to list pages during setup.

Data sent when an administrator publishes (or sends a test post): post caption text, image URL, Facebook Page ID, Instagram account ID, and access tokens stored on your site after OAuth. Requests go to `https://graph.facebook.com/`.

Service provider: Meta Platforms, Inc. — [Terms of Service](https://www.facebook.com/legal/terms), [Privacy Policy](https://www.facebook.com/privacy/policy/).

= Meta OAuth =

Used when an administrator clicks "Connect Facebook & Instagram" to authorize the plugin with their Meta app. The browser is redirected to `https://www.facebook.com/` for login; authorization codes and tokens are exchanged via the Meta Graph API and stored in your WordPress database.

Data sent during connection: OAuth authorization codes, app credentials configured by the administrator, and requested permission scopes. No visitor or front-end user data is sent.

Service provider: Meta Platforms, Inc. — [Terms of Service](https://www.facebook.com/legal/terms), [Privacy Policy](https://www.facebook.com/privacy/policy/).

= WordPress AI Connectors =

Used when a site administrator enables AI news suggestions. maca Njuvs sends site context (recent news titles and excerpts, upcoming events, business profile text, and topic instructions) to the AI provider configured under Settings → Connectors (OpenAI, Anthropic, or Google). Optional Instagram images may be generated via OpenAI Images API (gpt-image-1) using the same Connectors API key when WordPress AI Client image methods are unavailable. AI-generated content is saved as drafts for administrator review before any publishing. Credentials are managed by WordPress — maca Njuvs does not store AI API keys.

Service providers depend on which connector you configure — see each provider’s terms and privacy policy.

== Installation ==

1. In WordPress admin, go to *Plugins → Add New*, search for **maca Njuvs**, and click *Install Now* — or upload `maca-njuvs-{version}.zip` via *Upload Plugin*
2. Activate the plugin through the *Plugins* menu
3. Open **maca Njuvs** in the admin menu to add news and events

== Frequently Asked Questions ==

= Where is content stored? =

All content and settings are stored in maca Njuvs database tables and options on your WordPress site.

= How do I show news and events on pages? =

Add the **maca News** and **maca Events** blocks in the block editor, or use the shortcodes `[maca_njuvs_news]` and `[maca_njuvs_events]`.

= What data is sent to Maca? =

On activation, deactivation, and uninstall, the plugin sends your site URL, plugin version, WordPress version, PHP version, and locale to `https://api.maca.se/v1/njuvs/events.php`. If you submit deactivation feedback, your chosen reason and optional comment are included. No news, events, social tokens, or visitor data is sent.

= Do I need to accept terms before using the plugin? =

Yes. The first time you open maca Njuvs in admin you must read and accept the terms of use and privacy policy. News and events are not shown on the website until acceptance is recorded.

= How do AI suggestions work? =

Connect an AI provider under WordPress *Settings → Connectors*, then open *maca Njuvs → AI suggestions*. Add topics, choose a schedule (hourly, daily, weekly, monthly, or manual), and maca Njuvs creates draft news posts for your review. Nothing is published automatically. Requires WordPress 7.0 or later.

= How can I support development? =

If maca Njuvs is useful on your site, you may donate at https://maca.se/donation/ — thank you.

== Screenshots ==

1. News list in the maca Njuvs admin
2. Edit a news item with scheduling and social publishing options
3. Month calendar view on the frontend (maca Events block)
4. News list on the frontend (maca News block)
5. Gutenberg blocks in the block inserter
6. Recurring event editor in admin

== Upgrade Notice ==

= 1.0.57 =
Swedish translations for terms and privacy; fixed duplicate strings in translation file.

= 1.0.56 =
AI news suggestions (WordPress 7+), updated terms and guides, Plugin Check fixes, and donate link.

= 1.0.37 =
Smarter site URL detection for installation telemetry on proxied and loopback hosts.

= 1.0.36 =
Installation telemetry via api.maca.se and optional deactivation feedback on the Plugins screen.

= 1.0.35 =
maca Hub REST API for remote news and events; plugin links updated to maca.se.

= 1.0.31 =
First WordPress.org release. Install or update for news, events, iCal feed, and optional Facebook/Instagram publishing.

== Changelog ==

= 1.0.57 =
* Swedish translations for terms of use and privacy policy (acceptance screen).
* Fix duplicate entries in maca-njuvs-sv_SE.po so translations compile correctly.

= 1.0.56 =
* AI news suggestions via WordPress Connectors (drafts for review; site index; optional Instagram images; OpenAI Images API fallback using Connectors key).
* Terms of use and privacy policy updated for AI (version 2 — re-acceptance required).
* User guides updated in all languages with AI, telemetry, and API key documentation.
* Plugin Check compatibility fixes (security, i18n, WordPress 7 AI Client wrappers).
* Donate link in plugin header and readme (https://maca.se/donation/).
* Deactivation feedback on the Plugins screen; installation telemetry via api.maca.se.
* maca Hub REST API for remote news and events.

= 1.0.37 =
* Smarter site URL resolution for api.maca.se telemetry (prefers public domain over 127.0.0.1/localhost on proxied hosts).
* Defer activation telemetry to shutdown so request headers and WordPress URL filters are available.

= 1.0.36 =
* Installation telemetry: sends activate, deactivate, and uninstall events to `api.maca.se/v1/njuvs/events.php` (privacy disclosure in Description and FAQ).
* Deactivation feedback modal with preset reasons; feedback sent via the same API when submitted.

= 1.0.35 =
* Plugin URI and author URI point to maca.se
* REST API for maca Hub integration (`maca-hub/v1`: status, news, and events)
* Allow social publishing from authenticated Hub API requests

= 1.0.31 =
* WordPress.org listing: plugin URI and readme updated for the plugin directory
* Extract news/event admin form helpers to enqueued script (media picker, recurrence fields, large-image warning)

= 1.0.30 =
* Social publish progress bar moves continuously while waiting instead of jumping between steps

= 1.0.29 =
* Warn in admin when a selected news or event image is large (500 KB+); updated translations and guides

= 1.0.28 =
* Fix "Please reduce the amount of data" when saving news: lighter excerpt editor and strip pasted data-URI images

= 1.0.26 =
* Respect "Enable maca Njuvs" setting: stop auto-enabling and showing news when disabled

= 1.0.24 =
* Standalone plugin: removed maca Menulist integration and renamed internal API to maca_njuvs_*

= 1.0.22 =
* Exclude dev tools from release ZIP
* Escape output at echo time (wp_kses_post / wp_kses)

= 1.0.21 =
* WordPress.org review: enqueue admin and frontend scripts instead of inline tags
* Document Meta external services in readme
* Remove load_plugin_textdomain() (WordPress.org auto-loads translations)

= 1.0.12 =
* In-page news layout for tables and columns
* Plugin Check compatibility fixes

= 1.0.11 =
* Import on its own admin tab
* Standalone maca Njuvs product identity
* Release ZIP for WordPress upload

= 1.0.0 =
* Initial release — news, events, and iCal with dedicated tables
