=== Mynewsdesk ===
Contributors: mansoormunib, mnddev
Tags: press releases, mynewsdesk, pressroom, news, shortcode
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed press releases and other Mynewsdesk pressroom content in WordPress with the [mynewsdesk] shortcode.

== Description ==

wpMynewsdesk integrates the Mynewsdesk pressroom API with WordPress. Enter your Mynewsdesk API key in **Settings » myNewsDesk**, place the `[mynewsdesk]` shortcode anywhere on your site, and the plugin fetches and renders your press releases, news, blog posts, events, images, videos, documents and contacts.

This plugin is not built by Mynewsdesk and Mynewsdesk does not provide support for it.

**Highlights**

* Modern, object-oriented codebase (PHP 8.0+).
* All output is escaped; all input is sanitized.
* AJAX requests are protected by WordPress nonces.
* HTTP requests use the WordPress HTTP API (`wp_remote_get`) with timeout and user-agent.
* XML parsing is hardened against XXE (`LIBXML_NONET`).
* Compatible with WordPress 6.5 through 7.0.

== Installation ==

1. Upload the plugin folder to `wp-content/plugins/` or install it through the WordPress Plugins screen.
2. Activate the plugin from the Plugins screen.
3. Open **Settings » myNewsDesk** and enter your unique Mynewsdesk API key.
4. Set the pressroom site (country code such as `se` for Sweden or `uk` for the United Kingdom).
5. Pick a default media type and the media types you want to display.
6. Add the `[mynewsdesk]` shortcode to a page or post.

== Frequently Asked Questions ==

= Where do I get the API key? =

Contact the Mynewsdesk team to obtain an API key. See https://www.mynewsdesk.com/docs/webservice_pressroom for details.

= Why am I seeing "Unable to load content from Mynewsdesk"? =

The plugin could not reach the Mynewsdesk API or received an invalid XML response. Verify your API key, pressroom site and that outbound HTTPS traffic is allowed from your server.

== Changelog ==

= 2.0.0 =
* Rewrote the plugin as a namespaced, single-file OOP class.
* Added strict input sanitization and full output escaping across the admin UI, shortcode and AJAX responses.
* Added nonce verification (`check_ajax_referer`) to the AJAX endpoint.
* Replaced direct `DOMDocument::load($url)` calls with `wp_remote_get()` plus hardened `SimpleXML` parsing (`LIBXML_NONET`).
* Switched the API endpoint to HTTPS.
* Replaced deprecated `screen_icon()` and `WP_PLUGIN_URL` usage with modern equivalents (`plugin_dir_url`, `add_query_arg`).
* Migrated the settings screen to the WordPress Settings API with `sanitize_callback` for each option.
* Migrated the AJAX response to `wp_send_json_success` / `wp_send_json_error`.
* Renamed internal option keys (`kkpo_*` → `mnd_*`). Existing installs are migrated automatically on activation or first admin load; legacy values are preserved so downgrades remain safe.
* Set requirements: WordPress 6.5+, PHP 8.0+.

= 1.5 =
* Legacy release.

== Upgrade Notice ==

= 2.0.0 =
Major modernization for WordPress 6.5–7.0 and PHP 8.0+. Settings from previous versions (API key, pressroom site, media types) are migrated automatically — no reconfiguration required.
