{"id":133409,"date":"2020-12-19T15:12:04","date_gmt":"2020-12-19T15:12:04","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wp-wpcat-json-rest\/"},"modified":"2026-06-12T07:43:45","modified_gmt":"2026-06-12T07:43:45","slug":"wp-wpcat-json-rest","status":"publish","type":"plugin","link":"https:\/\/pl.wordpress.org\/plugins\/wp-wpcat-json-rest\/","author":17798871,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"3.0.0","stable_tag":"3.0.0","tested":"7.0","requires":"6.2","requires_php":"8.2","requires_plugins":null,"header_name":"Media Library Extension","header_author":"Martin von Berg","header_description":"Extend the WP-REST-API to work with Wordpress Media-Library directly. Add and Update images even to folders. Only with Authorization.","assets_banners_color":"","last_updated":"2026-06-12 07:43:45","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.berg-reise-foto.de\/software-wordpress-lightroom-plugins\/wordpress-plugins-fotos-und-gpx\/","header_plugin_uri":"https:\/\/github.com\/MartinvonBerg\/Ext_REST_Media_Lib","header_author_uri":"https:\/\/www.berg-reise-foto.de\/software-wordpress-lightroom-plugins\/wordpress-plugins-fotos-und-gpx\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":5193,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.0.15":{"tag":"0.0.15","author":"martinvonberg","date":"2021-10-05 17:03:12"},"0.0.16":{"tag":"0.0.16","author":"martinvonberg","date":"2022-01-23 18:03:28"},"0.0.17":{"tag":"0.0.17","author":"martinvonberg","date":"2021-11-07 16:14:51"},"0.0.18":{"tag":"0.0.18","author":"martinvonberg","date":"2022-01-23 18:19:11"},"0.0.19":{"tag":"0.0.19","author":"martinvonberg","date":"2022-01-24 18:26:42"},"0.1.0":{"tag":"0.1.0","author":"martinvonberg","date":"2022-02-15 18:48:37"},"0.1.2":{"tag":"0.1.2","author":"martinvonberg","date":"2022-05-26 09:56:11"},"0.1.3":{"tag":"0.1.3","author":"martinvonberg","date":"2022-11-17 18:53:57"},"0.1.4":{"tag":"0.1.4","author":"martinvonberg","date":"2023-08-11 06:02:40"},"0.1.5":{"tag":"0.1.5","author":"martinvonberg","date":"2024-10-11 14:53:50"},"1.0.0":{"tag":"1.0.0","author":"martinvonberg","date":"2024-10-21 16:48:49"},"1.1.0":{"tag":"1.1.0","author":"martinvonberg","date":"2025-05-19 09:46:56"},"1.2.0":{"tag":"1.2.0","author":"martinvonberg","date":"2025-12-04 09:10:00"},"3.0.0":{"tag":"3.0.0","author":"martinvonberg","date":"2026-06-12 07:43:45"}},"upgrade_notice":{"":"<p>Upgrade to 3.0.0 is not necessary. Only, if  you want to use the new image resizing class for smaller images and \/ or the the new hook method for metadata.<\/p>"},"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.0.15","0.0.16","0.0.17","0.0.18","0.0.19","0.1.0","0.1.2","0.1.3","0.1.4","0.1.5","1.0.0","1.1.0","1.2.0","3.0.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[233,266786,23853,259,266787],"plugin_category":[50],"plugin_contributors":[194255],"plugin_business_model":[],"class_list":["post-133409","plugin","type-plugin","status-publish","hentry","plugin_tags-media-library","plugin_tags-media-catalog","plugin_tags-rest-api","plugin_tags-upload","plugin_tags-wpcat","plugin_category-media","plugin_contributors-martinvonberg","plugin_committers-martinvonberg"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-wpcat-json-rest.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Extend the REST-API to work with Wordpress Media-Library. Organize images in Folders. Add and Update images including Metadata and Posts using the images. Access with Authorization only.\nThis plugin extends the REST-API of Wordpress to directly access the Media-Library for Images. It is intended to be used together with a Lightroom Plugin or as a stand-alone interface for headless WordPress. The new REST-API endpoints (functions) allow to add additional metadata to images, update existing metadata or update images completely without changing the Wordpress-ID. Images may be added to the standard directory hierarchy of wordpress or to an additional folder which allows better organization and searching for images.\nNEW FUNCTION : See 3.2<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Visit the plugins page on your Admin-page and click  \u2018Add New\u2019<\/li>\n<li>Search for 'wp_wpcat_json_rest', or 'JSON' and 'REST'<\/li>\n<li>Once found, click on 'Install'<\/li>\n<li>Go to the plugins page and activate the plugin<\/li>\n<li>Go to Admin Settings and activate what you prefer.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>There are no FAQs just yet.<\/p>\n\n<!--section=changelog-->\n<h4>0.0.1 to 0.0.6<\/h4>\n\n<ul>\n<li>Development phase<\/li>\n<\/ul>\n\n<h4>0.0.7<\/h4>\n\n<ul>\n<li>First working release: 1.04.2020<\/li>\n<\/ul>\n\n<h4>0.0.8<\/h4>\n\n<ul>\n<li>Translation of comments. Preparation for wordpress.org Plugin-directory<\/li>\n<\/ul>\n\n<h4>0.0.9<\/h4>\n\n<ul>\n<li>Adaptations for publish to wordpress.org Plugin-directory\n\n<ul>\n<li>implemented namespace for the plugin<\/li>\n<li>changed define to const (only const is in the namespace, define not)<\/li>\n<li>changed the REST-namespace<\/li>\n<li>removed all wpcat and wp_ - prefixes for plugin-code, except in comments<\/li>\n<li>GET - \/addfromfolder provides now a list with id's and original-files that are already added to the media-library<\/li>\n<li>changed permission callbacks to is_user_logged_in<\/li>\n<li>added required = true to args of rest-route-functions<\/li>\n<li>added authorization required for complete REST-API<\/li>\n<li>fixed md5_original_file request for deleted files in folder, but still in media-library<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h4>0.0.10<\/h4>\n\n<ul>\n<li>Removed minor inconsistencies at the rest_field definitions<\/li>\n<\/ul>\n\n<h4>0.0.11<\/h4>\n\n<ul>\n<li>added namespace to inner functions<\/li>\n<\/ul>\n\n<h4>0.0.12<\/h4>\n\n<ul>\n<li>set resize quality back to standard value (82). Images were too big!<\/li>\n<\/ul>\n\n<h4>0.0.13<\/h4>\n\n<ul>\n<li>Readme updated. No functional change.<\/li>\n<li>2020-02-12: Test with WP5.6.1 an PHP8.0 on live site: no errors reported. Works!<\/li>\n<li>PHP-Compatibility check with phpcs. Compatible from PHP 5.4 - 8.0. But keep PHP 7.0 as minimum version<\/li>\n<li>Update to keep some WP coding guideline. But still not all! Only partially done.<\/li>\n<\/ul>\n\n<h4>0.0.14<\/h4>\n\n<ul>\n<li>Readme and docblocks updated. <\/li>\n<li>Added functionality to handle webp images as well. Tested with WP 5.8-RC4 test version.<\/li>\n<\/ul>\n\n<h4>0.0.15<\/h4>\n\n<ul>\n<li>Update function updated! The update includes now also ALL posts that are using the updated image. All links are changed to the new links.<\/li>\n<li>The plugin is partly re-using the great work of 'Enable Media Replacer' that solved the task already for manual updates via the frontend.<\/li>\n<li>Aditionally the 'alt-text' and the 'caption' are updated if the are used in gutenberg blocks 'image', 'gallery' and 'media-with-text'. <\/li>\n<li>Important: There are many, many other blocks, images, galleries around. For these I couldn't realize the update of 'alt-text' and 'caption'.<\/li>\n<li>BUT: The links are updated!<\/li>\n<li>Code quality check with phpstan: level 5 is OK except 19 remaining Errors. These were carefully checked and regarded as OK. Minor changes to reach level 5.<\/li>\n<\/ul>\n\n<h4>0.0.16<\/h4>\n\n<ul>\n<li>Bug-Fix for Image Update with same filename. Python testcase added for that and successfully tested.<\/li>\n<\/ul>\n\n<h4>0.0.17<\/h4>\n\n<ul>\n<li>Just a new tag for SVN upload test<\/li>\n<\/ul>\n\n<h4>0.0.18<\/h4>\n\n<p>*Code-Rework:\n* loaded updated emrFile.php from github\n* split helper functions in several files and renamed \/inc to \/includes\n* simplified loading of WP-Error class\n* added a programatical filter for image quality. Standard is now 80 for jpeg and 40 for webp.\n* tested the whole bunch of changes with the python-test-suite and Lightroom.\n* The further code rework acc. to: https:\/\/carlalexander.ca\/designing-system-wordpress-rest-api-endpoints\/ or\n* https:\/\/torquemag.io\/2018\/03\/advanced-oop-wordpress-customizing-rest-api-endpoints-improve-wordpress-search\/ looks very promising but won't be done.<\/p>\n\n<h4>0.0.19<\/h4>\n\n<ul>\n<li>Just a new tag for SVN upload test<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Rework of the image update function (endpoint of POST-Request \/update\/): The function updates the image FILE only and the filename if provided in POST request. <\/li>\n<li>Content, description, alt-text, parent ASO are now kept and no longer overwritten.<\/li>\n<li>Change the modified date, only and not the published date on changes. Valid for image and post that uses it.<\/li>\n<li>Set the slug and permalink according to title, if the title is changed.<\/li>\n<li>If the title of the old image was different from the filename than title will be kept. All other meta-data remains unchanged including post-parent.<\/li>\n<li>Minimum required PHP version is 7.3 now as now tests with 7.2 were done.<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Code Refactoring and meaningful PHPunit tests completed<\/li>\n<\/ul>\n\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Test with WordPress 6.0.<\/li>\n<\/ul>\n\n<h4>0.1.3<\/h4>\n\n<ul>\n<li>Test with WordPress 6.1. Minor Bug Fixes.<\/li>\n<\/ul>\n\n<h4>0.1.4<\/h4>\n\n<ul>\n<li>Test with WordPress 6.2. Minor Bug Fixes especially in image_update_callback.php.<\/li>\n<\/ul>\n\n<h4>0.1.5<\/h4>\n\n<ul>\n<li>Minor Bug Fixes in image_update_callback.php: added the do_action. This is the event trigger for the Pugin to strip metadata.<\/li>\n<li>Test with WordPress 6.3<\/li>\n<\/ul>\n\n<h4>0.1.5<\/h4>\n\n<ul>\n<li>Test with WordPress 6.4. No changes. Detected Issue during test: If image is attached to parent the SQL wpdb-&gt;query does not update the post! Detected WordPress-Feature: The Post is not updated if it is open for editing.<\/li>\n<\/ul>\n\n<h4>0.1.5<\/h4>\n\n<ul>\n<li>Test with WordPress 6.6. No changes.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Added support for AVIF-Files and tested with WordPress 6.6.2. Minor change of quality for image resizing. Increased minimum versions of WP and PHP.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>EXPERIMENTAL !!!<\/li>\n<li>Added an own class to generate the image-sizes with ImageMagick. This produces smaller files as expected where AVIF is 0.5 Jpeg-size and -30% of WebP-size.<\/li>\n<li>The calculation times are roughly:<\/li>\n<li>JPEG : 2.0 s, WEBP : 3.0 s, AVIF : 4.8 s on my local machine. Without my Image_Editor its 2.6s for AVIF only! Tested with 1 image only!<\/li>\n<li>Tested with WordPress 6.7-RC4 This class to generate the image-sizes with ImageMagick is used always! For every upload!<\/li>\n<li>Added new routes and functions to handle local generated images.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Test with WordPress 6.8. No changes.<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Test with WordPress 6.9. No changes for that. Minor Update of PHP-Function post_add_file_to_folder() for better folder name generation. Added PHPUnit Tests for the new PHP-functions.<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Updated minimum PHP-Version to 8.0 (8.3 would be even better)<\/li>\n<li>Updated method doMetaReplaceQuery() in replacer.php as start of update to new WP and PHP principles. (Old code works but is very old fashioned)<\/li>\n<\/ul>\n\n<h4>3.0.0<\/h4>\n\n<ul>\n<li>Update method doMetaReplaceQuery in replacer.php. Used Copilot to review and update replacer.php for PHPStan Level 8.<\/li>\n<li>Added a new hook for the standard media upload to have Metadata for webp and avif identical to jpg. Rework of Metadata Extractor.<\/li>\n<li>Rework of 'trigger_after_rest' for PHPStan Level 8 and removed the update of the slug in title change. Implemented the usage of the new setting to update content with caption and title.<\/li>\n<li>BREAKING CHANGE: Minimum PHP is now 8.x. Minor Updates in almost all PHP-Files.<\/li>\n<li>Added simple Admin Settings page mainly for the new Hook (AdminSettings.php.) and some for the existing REST-API.<\/li>\n<li>Test with WP 7.0<\/li>\n<li>Rebranding: Plugin renamed to \"Media Library Extension\"<\/li>\n<\/ul>","raw_excerpt":"Extend the REST-API to work with Wordpress Media-Library. Organize images in Folders. Add and Update images including Metadata and Posts using the ima &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/133409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=133409"}],"author":[{"embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/martinvonberg"}],"wp:attachment":[{"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=133409"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=133409"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=133409"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=133409"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=133409"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=133409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}