aspirepress / updater-plugin

A plugin that allows for rewriting the URLs used to fetch updates from WordPress.org to some other endpoint
4 stars 0 forks source link

Add administrator control panel UI #3

Open asirota opened 2 hours ago

asirota commented 2 hours ago

We don't have support right now for configuring this plugin through the UI.

Here are the settings currently supported:

The plugin requires the following configuration options:

<?php

define('AP_UPDATER_HOST_REWRITES', [ 'api.wordpress.org' => 'your-repo.com', ]); There are other options for defining the plugin's functionality, as well. They are:

AP_UPDATER_API_KEY - Provides an API key for repositories that may require authentication. AP_UPDATER_REWRITE_WPORG_API - Uses the built-in WordPress API rewrite rules. Must be configured with AP_UPDATER_API_URL. AP_UPDATER_REWRITE_WPORG_DL - Uses the built-in WordPress download rewrite rules. Must be configured with AP_UPDATER_DL_URL. AP_UPDATER_API_URL - The URL to use for the third-party plugin API. Must be configured with AP_UPDATER_REWRITE_WPORG_API. AP_UPDATER_DL_URL - The URL to use for the third-party plugin download API. Must be configured with AP_UPDATER_REWRITE_WPORG_DL. AP_UPDATER_DEBUG - Enables debug mode for the plugin. AP_UPDATER_DEBUG_TYPES - Defines the types of messages you want output as an array. Presently supports request, response and string AP_UPDATER_DEBUG_TYPES_EXCLUDE - Defines any types you DON'T WANT displayed. This runs AFTER the AP_UPDATER_DEBUG_TYPES does, so it will remove anything you previously added if both are defined. AP_UPDATER_DEBUG_LOG_PATH - Defines where to write the log. The log file name is hard-coded, but the path is up to you. File must be writable. AP_UPDATER_DEBUG_SSL - Disables the verification of SSL to allow local testing. AP_UPDATER_EXAMINE_RESPONSES - Examines the response and logs it as a debug value when set to true.

I'll try AI to build this.

asirota commented 2 hours ago

There are three output options, all enabled by default:

request - Outputs the request URL and headers. response - Outputs the response headers and body. string - Outputs the string that is being rewritten. These are turned on by default but you can remove ones you don't need by defining them in the AP_UPDATER_DEBUG_TYPES_EXCLUDE constant.