@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-add-media-from-url/>
  a sioc:Post ;
  dc:title "Changelog" ;
  dcterms:identifier 147244 ;
  dc:modified "2026-09-12T11:55:20Z"^^xsd:dateTime ;
  dc:created "2026-09-12T11:18:27Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-add-media-from-url/changelog/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Type:</strong> Doc-section</li><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-add-media-from-url/">LH Add Media from URL</a></li></ul><p class="wp-block-paragraph"><strong>1.36 September 12, 2026</strong>
Cast <code>$parent_post-&gt;post_author</code> to int before passing to <code>wp_update_post()</code> (PHPStan finding — <code>WP_Post</code> properties come back as strings from the DB).</p><p class="wp-block-paragraph"><strong>1.35 September 12, 2026</strong>
Removed the dead <code>reconstruct_url()</code> method (confirmed unused anywhere in the plugin). Split <code>plugin_options()</code> into a controller and a new <code>partials/admin-page.php</code> view, matching the existing <code>partials/upload.php</code> convention — the whole admin page&#8217;s markup now lives in <code>partials/</code>, none of it inline in the class.</p><p class="wp-block-paragraph"><strong>1.34 September 12, 2026</strong>
Plugin-check hardening: added <code>ABSPATH</code> direct-access guards, escaped output (<code>esc_html__</code>/<code>esc_attr</code>/<code>esc_html</code>), sanitized and unslashed <code>$_POST</code>/<code>$_GET</code> reads with <code>isset()</code> checks, replaced <code>unlink()</code> with <code>wp_delete_file()</code>, removed the discouraged <code>load_plugin_textdomain()</code> call (WordPress auto-loads translations for wp.org-hosted plugins since 4.6), added a <code>License</code>/<code>License URI</code> header. Readme cleanup: tags trimmed to 5, &quot;Tested up to&quot; bumped to 7.1, Stable tag synced to the plugin version.</p><p class="wp-block-paragraph"><strong>1.33 September 12, 2026</strong>
Added the <code>lh-add-media-from-url/add-media-from-url</code> MCP ability (gated to <code>upload_files</code>, matching the manual upload form&#8217;s own capability check), wrapping <code>save_external_file()</code> so an MCP agent can fetch a remote URL into the media library the same way the manual wp-admin form does.</p><p class="wp-block-paragraph"><strong>1.32 September 12, 2026</strong>
Added <code>plugin_name()</code>/<code>plugin_version()</code> identity methods and an init filter gate (<code>lh_add_media_from_url_init_plugin</code>), per LH plugin conventions.</p><p class="wp-block-paragraph"><strong>1.31 September 12, 2026</strong>
Removed a stray invalid line sitting before the class declaration. Fixed <code>reconstruct_url()</code> (was reading <code>hostname</code> instead of <code>host</code>). Removed dead bookmarklet code. <code>handle_upload_v2()</code> now returns a <code>WP_Error</code> on a failed capability check instead of silently returning <code>null</code>. <code>add_media_from_url()</code> no longer redirects on an empty result. Renamed <code>includes/lh-copy-from-url-class.php</code> -&gt; <code>includes/lh-add-media-from-url-copy-from-url.php</code> (class <code>LH_copy_from_url_class</code> -&gt; <code>LH_add_media_from_url_copy_from_url</code>), now a composed helper aligned to the plugin&#8217;s own namespace (this also renamed the <code>_remote_get_args</code> filter from <code>lh_copy_from_url_class_remote_get_args</code> to <code>lh_add_media_from_url_remote_get_args</code>). <code>guess_file_extension()</code> now uses <code>wp_check_filetype_and_ext()</code> against the local temp file instead of a second, unprotected fetch of the remote URL via <code>exif_imagetype()</code>.</p><p class="wp-block-paragraph"><strong>1.30 August 20, 2024</strong>
Minor security fix.</p><p class="wp-block-paragraph"><strong>1.23 January 15, 2024</strong>
Bug fix.</p><p class="wp-block-paragraph"><strong>1.22 April 16, 2021</strong>
Bug fix.</p><p class="wp-block-paragraph"><strong>1.21 April 08, 2021</strong>
Added a filter to wp_remote_get.</p><p class="wp-block-paragraph"><strong>1.20 March 05, 2021</strong>
Updated lh-copy-from-url-class.php again.</p><p class="wp-block-paragraph"><strong>1.15 October 08, 2017</strong>
Updated lh-copy-from-url-class.php.</p><p class="wp-block-paragraph"><strong>1.14 September 13, 2017</strong>
Added language directory.</p><p class="wp-block-paragraph"><strong>1.13 September 13, 2017</strong>
Translatable strings.</p><p class="wp-block-paragraph"><strong>1.12 August 05, 2017</strong>
Latest copy file class.</p><p class="wp-block-paragraph"><strong>1.11 August 03, 2017</strong>
Separate file.</p><p class="wp-block-paragraph"><strong>1.10 July 30, 2017</strong>
Moved uploader to separate class.</p><p class="wp-block-paragraph"><strong>1.09 July 30, 2017</strong>
File type fixes.</p><p class="wp-block-paragraph"><strong>1.08 July 30, 2017</strong>
Rejigged upload handling.</p><p class="wp-block-paragraph"><strong>1.06 March 11, 2016</strong>
More documentation.</p><p class="wp-block-paragraph"><strong>1.05 March 10, 2016</strong>
Added documentation.</p><p class="wp-block-paragraph"><strong>1.0 November 13, 2015</strong>
Initial release.</p>"""^^rdf:XMLLiteral ;
  sioc:content """Type: Doc-sectionPart of: LH Add Media from URL1.36 September 12, 2026
Cast $parent_post-&gt;post_author to int before passing to wp_update_post() (PHPStan finding — WP_Post properties come back as strings from the DB).1.35 September 12, 2026
Removed the dead reconstruct_url() method (confirmed unused anywhere in the plugin). Split plugin_options() into a controller and a new partials/admin-page.php view, matching the existing partials/upload.php convention — the whole admin page&#8217;s markup now lives in partials/, none of it inline in the class.1.34 September 12, 2026
Plugin-check hardening: added ABSPATH direct-access guards, escaped output (esc_html__/esc_attr/esc_html), sanitized and unslashed $_POST/$_GET reads with isset() checks, replaced unlink() with wp_delete_file(), removed the discouraged load_plugin_textdomain() call (WordPress auto-loads translations for wp.org-hosted plugins since 4.6), added a License/License URI header. Readme cleanup: tags trimmed to 5, &quot;Tested up to&quot; bumped to 7.1, Stable tag synced to the plugin version.1.33 September 12, 2026
Added the lh-add-media-from-url/add-media-from-url MCP ability (gated to upload_files, matching the manual upload form&#8217;s own capability check), wrapping save_external_file() so an MCP agent can fetch a remote URL into the media library the same way the manual wp-admin form does.1.32 September 12, 2026
Added plugin_name()/plugin_version() identity methods and an init filter gate (lh_add_media_from_url_init_plugin), per LH plugin conventions.1.31 September 12, 2026
Removed a stray invalid line sitting before the class declaration. Fixed reconstruct_url() (was reading hostname instead of host). Removed dead bookmarklet code. handle_upload_v2() now returns a WP_Error on a failed capability check instead of silently returning null. add_media_from_url() no longer redirects on an empty result. Renamed includes/lh-copy-from-url-class.php -&gt; includes/lh-add-media-from-url-copy-from-url.php (class LH_copy_from_url_class -&gt; LH_add_media_from_url_copy_from_url), now a composed helper aligned to the plugin&#8217;s own namespace (this also renamed the _remote_get_args filter from lh_copy_from_url_class_remote_get_args to lh_add_media_from_url_remote_get_args). guess_file_extension() now uses wp_check_filetype_and_ext() against the local temp file instead of a second, unprotected fetch of the remote URL via exif_imagetype().1.30 August 20, 2024
Minor security fix.1.23 January 15, 2024
Bug fix.1.22 April 16, 2021
Bug fix.1.21 April 08, 2021
Added a filter to wp_remote_get.1.20 March 05, 2021
Updated lh-copy-from-url-class.php again.1.15 October 08, 2017
Updated lh-copy-from-url-class.php.1.14 September 13, 2017
Added language directory.1.13 September 13, 2017
Translatable strings.1.12 August 05, 2017
Latest copy file class.1.11 August 03, 2017
Separate file.1.10 July 30, 2017
Moved uploader to separate class.1.09 July 30, 2017
File type fixes.1.08 July 30, 2017
Rejigged upload handling.1.06 March 11, 2016
More documentation.1.05 March 10, 2016
Added documentation.1.0 November 13, 2015
Initial release.""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
