Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Install and update WordPress themes and plugins directly from your Git repository via GitHub, Gitlab or Bitbucket.

License

NotificationsYou must be signed in to change notification settings

nico-martin/git-installer

Repository files navigation

Git Installer Banner

Git Installer

Install and update WordPress themes and plugins directly from your Git repository via GitHub, Gitlab or Bitbucket.

"Git Installer" works with public and private repositories, different branches, subdirectories and even allows automatedupdates via webhooks. Furthermore, plugins or themes are automatically recognised and validated and it also supportsmust use plugins and multisite installations.

Download

https://update.git-installer.com/zip.php?release=latest

Features

FeatureStatus
Install and update Plugins from Git repositories
Provider
- GitHub
- Gitlab
- Bitbucket
Webhook updates
Integrated WordPress update process
View pending updates directly in the WordPress overview and update them individually or as a bulk update.
Private Repositories
Must Use Plugin support
https://wordpress.org/support/article/must-use-plugins/
Branchesany branch
Multisite
Install from subdirectories
Check directory
Validates a Repository and checks wether a valid WordPress theme or plugin is found.
Postupdate Hooks
Run your composer, NPM or other builds after the update

Webhook updates

"Git Installer" enables updates to be carried out automatically via a webhook. For each package, a "Webhook Update URL"is created, which must be deposited with the respective provider.

GitHub

Repository -> Settings -> Webhooks -> Add webhook:

  • Payload URL: the Webhook Update URL
  • Content type: application/x-www-form-urlencoded
  • Secret: none
  • Which events would you like to trigger this webhook?: Just the push event

Gitlab

Repository -> Settings -> Webhooks:

  • URL: the Webhook Update URL
  • Trigger: Push events (Branch name should match the branch you are using, blank works as well)
  • Secret token: none
  • SSL verification: checked

Bitbucket

Repository -> Repository settings -> Workflow -> Webhooks -> Add webhook:

  • Title: choose your own
  • URL: the Webhook Update URL
  • Active: checked
  • SSL/TLS: unchecked
  • Triggers: Repository > Push

Hooks

Plugin Update action

An action that runs after a successful update.

add_action('shgi/GitPackages/updatePackage/success',function($packageKey,$ref,$prevVersion,$nextVersion){// $packageKey: string    = the key of the plugin or theme. Usually the name of the github repo// $ref: string           = key of the "refOption" defined in `shgi/UpdateLog/refOptions`// $prevVersion: string   = version before the update// $nextVersion: string   = version after the update},20,4);

An action that runs after a failed update.

add_action('shgi/GitPackages/updatePackage/error',function($packageKey,$ref,$reason){// $packageKey: string    = the key of the plugin or theme. Usually the name of the github repo// $ref: string           = key of the "refOption" defined in `shgi/UpdateLog/refOptions`// $reason: WP_Error      = a reason why the update failed},20,3);

Must Use Plugin

Activate "Must Use Plugin" support

add_filter('shgi/Repositories/MustUsePlugins','__return_true');

Now you are able to select the target folder for your plugin before the installation.

Update Referer

Updates are usually done via a REST endpoint:

`${REST_API}/git-installer/v1/git-packages-deploy/${REPOSITORY_SLUG}/?key=${REPOSITORY_SECRET}`

This endpoint accepts an additional GET parameter calledref which is used for logging.

`${REST_API}/git-installer/v1/git-packages-deploy/${REPOSITORY_SLUG}/?key=${REPOSITORY_SECRET}&ref=webhook-update`

If needed, further refferer values can be added via a filter.

add_filter('shgi/UpdateLog/refOptions',function($refs){/**   * Initial values:   * [   *   'install' => __('Install', 'shgi'),   *   'webhook-update' => __('webhook', 'shgi'),   *   'update-trigger' => __('update button', 'shgi')   * ]   */$refs['my-ref'] ='My custom trigger';return$refs;});

Custom Postupdate Hooks

add_filter('shgi/Hooks/PostupdateHooks',function($hooks){$hooks['my-custom-hook'] = ['title' =>'My Custom Hook','description' =>'Describe what the hook will do','function' =>function($package){// this function will run after a successfull update// $package is the full Package-Object    },'check' =>function(){// returns a boolean wether the system supports this hook (for example if npm/composer is installed)returntrue;    }  ];return$hooks;});

Composer

By default, git-installer uses thecomposer-alias to run composer. If your configuration does not support aliases, you can also define aSHGI_COMPOSER_COMMAND constant in thewp-config.php:

define('SHGI_COMPOSER_COMMAND','~/bin/composer');

Author

Nico Martin
nico.dev -github.com/nico-martin

About

Install and update WordPress themes and plugins directly from your Git repository via GitHub, Gitlab or Bitbucket.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp