aspirepress / AspireUpdate

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

Add New Plugin - call only to WP and not AP #17

Open ipajen opened 7 hours ago

ipajen commented 7 hours ago

if I go to /wp-admin/plugin-install.php only a call is made to Wp and not to AP

plugins_api() wp-admin/includes/plugin-install.php:173 WP_Plugin_Install_List_Table->prepare_items() wp-admin/includes/class-wp-plugin-install-list-table.php:242

mzalewski commented 3 hours ago

Caused by rewrite exclusion:


class AspirePress_ApiWordpressOrgRewriteRule implements AspirePress_RewriteRuleInterface
{
    use AspirePress_RewriteRuleTrait;

    public function __construct(string $apiDestination)
    {
        $this->setHostRewriteRule('api.wordpress.org', $apiDestination);
        $this->setExcludedPathRewriteRule('/plugins/info/1.2/');
    }
}