An open API service indexing awesome lists of open source software.

https://github.com/jeffpaul/classifai-local-media-http

Serve attachment URLs over http on .local sites to avoid self-signed certificate issues that break image processing (for example when ClassifAI reads media via URL).
https://github.com/jeffpaul/classifai-local-media-http

classifai https images local plugin ssl wordpress

Last synced: 28 days ago
JSON representation

Serve attachment URLs over http on .local sites to avoid self-signed certificate issues that break image processing (for example when ClassifAI reads media via URL).

Awesome Lists containing this project

README

          

=== ClassifAI - Local Media over HTTP ===
Contributors: jeffpaul
Tags: classifai, local, ssl, https, images
Tested up to: 6.8
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://spdx.org/licenses/GPL-2.0-or-later.html

Serve attachment URLs over http on .local sites to avoid self-signed certificate issues that break image processing (for example when ClassifAI reads media via URL).

== Description ==
On local development environments that use a self-signed certificate, PHP may fail to fetch media over https with errors like:

- `SSL routines:tls_process_server_certificate:certificate verify failed`

This plugin forces media URLs to use http when your site's host ends with `.local` or equals `localhost`. It targets:

- `wp_get_attachment_url()`
- `wp_get_attachment_image_src()`
- `wp_calculate_image_srcset()`
- Uploads base URL from `wp_upload_dir()`

It is safe to remove in production.

== Installation ==
1. Upload the ZIP in Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Go to your media workflow and try again.

== Filters ==
- `clmh_is_local( $is_local, $host )` — return true to enable forcing http even if your domain does not end with .local.

== Changelog ==
= 0.1.0 =
* First release.