描述
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.
安装
- Upload the plugin folder to
wp-content/plugins/or install it through the WordPress Plugins screen. - Activate the plugin from the Plugins screen.
- Open Settings » myNewsDesk and enter your unique Mynewsdesk API key.
- Set the pressroom site (country code such as
sefor Sweden orukfor the United Kingdom). - Pick a default media type and the media types you want to display.
- Add the
[mynewsdesk]shortcode to a page or post.
常见问题
-
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.
贡献者及开发者
更新日志
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 withwp_remote_get()plus hardenedSimpleXMLparsing (LIBXML_NONET). - Switched the API endpoint to HTTPS.
- Replaced deprecated
screen_icon()andWP_PLUGIN_URLusage with modern equivalents (plugin_dir_url,add_query_arg). - Migrated the settings screen to the WordPress Settings API with
sanitize_callbackfor 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.
