{"id":20209865,"url":"https://github.com/rask/wppr","last_synced_at":"2025-06-25T13:38:02.167Z","repository":{"id":71398915,"uuid":"131907841","full_name":"rask/wppr","owner":"rask","description":"WordPress Plugin Repofier, makes private/paid WP plugins Composer friendlier","archived":false,"fork":false,"pushed_at":"2018-10-30T14:12:14.000Z","size":58,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T10:31:56.342Z","etag":null,"topics":["composer","wordpress","wordpress-ci","wordpress-development","wordpress-plugin-development","wordpress-plugins"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rask.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-02T21:29:50.000Z","updated_at":"2021-03-01T05:01:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"df479713-336b-409b-9d71-5f3961ce4ee8","html_url":"https://github.com/rask/wppr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rask/wppr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rask%2Fwppr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rask%2Fwppr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rask%2Fwppr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rask%2Fwppr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rask","download_url":"https://codeload.github.com/rask/wppr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rask%2Fwppr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261883825,"owners_count":23224568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","wordpress","wordpress-ci","wordpress-development","wordpress-plugin-development","wordpress-plugins"],"created_at":"2024-11-14T05:43:06.188Z","updated_at":"2025-06-25T13:38:02.137Z","avatar_url":"https://github.com/rask.png","language":"Rust","readme":"# rask/wppr\n\n\u003e WordPress Plugin Repofier\n\n[![Build Status](https://travis-ci.org/rask/wppr.svg?branch=master)](https://travis-ci.org/rask/wppr) [![codecov](https://codecov.io/gh/rask/wppr/branch/master/graph/badge.svg)](https://codecov.io/gh/rask/wppr)\n\n\n**Currently unstable and in development, please proceed with caution if you plan\nto use this in production. This README states a future state on some parts so\nfollowing this README further than the _Installation_ steps may or may not\nwork as expected. Version 1.0.0 aims to fulfill the features outlined in this\nREADME.**\n\nMost paid, private, or otherwise custom plugins are rather difficult to manage\nin a WordPress installation that is managed with [Composer][composer].\n\nWPPR helps with that by taking the private plugins and making Composer friendly\nGit repositories from them.\n\nInstead of setting up complex setups in CI scripts or otherwise you can use\nthe plugins in a similar fashion as you would use WPackagist plugins.\n\n\u003e   **DISCLAIMER**: This tool does not fetch and install paid or private plugins\n\u003e   for you for free. You still need to buy and install them by hand for the\n\u003e   initial setup.\n\u003e\n\u003e   The authors of this tool are not responsible for issues that may arise from\n\u003e   using this tool in case you run into issues with plugin authors. Thanks\n\u003e   for understanding.\n\n[composer]: https://getcomposer.org\n\n## Features\n\n-   Makes paid plugins such as Advanced Custom Fields PRO or GravityForms\n    simpler to install with Composer\n-   Automatically upgrades the plugins\n-   Manages simple Git history for the plugins\n-   Creates Git tags for the plugins during upgrades\n-   Pushes upgraded plugins into a remote Git repository of your choosing\n\n### Development status\n\nA simple project base is currently ready with command and argument handling.\nCurrent version supports plugin listing commands only. Active development of\nupgrade, Composerization, and Gitification commands is underway.\n\n## Installation\n\nWPPR currently runs on `x86_64` compatible Linux systems (this includes most\npopular distros like Ubuntu).\n\nWPPR requires the following to be available in your system:\n\n-   Git\n-   WP-CLI\n-   Access to remote Git repositories with push rights\n\nWPPR is best run with a cron trigger, meaning you probably want to run it on\na server. Manual runs are possible as well but you lose the benefit of automated\nreleases for the plugins.\n\n### Download a binary\n\nThe WPPR binaries are standalone binaries, meaning you can download and run them\nas is. Download a binary into a location that is defined in your system's\n`$PATH`, e.g. `/usr/bin/wppr`.\n\n### From sources\n\nRequirements:\n\n-   Stable Rust compiler (`rustc` and Cargo)\n-   Git\n-   Linux environment\n\nClone this repository and compile the tool with\n\n    $ git clone \u003crepo\u003e wppr\n    $ cd wppr\n    $ cargo test\n    $ cargo build --release\n\nAfter this an operable executable should be sitting in\n\n    ./wppr/target/release/wppr\n\nYou should copy this binary to a location which has been defined in your\nsystem's `$PATH`, e.g. `/usr/bin/wppr`. Executing it as follows\n\n    $ wppr --help\n\nshould display a help screen with name and version information, if this is not\nthe case then the cloned version has a error in it most probably.\n\n## Setup\n\nBefore you can start using WPPR you need to create a WordPress installation into\nyour system which hosts the plugins that WPPR manages. The installation has the\nfollowing requirements:\n\n-   It is installed and configured like any regular WordPress installation\n-   Plugins inside the installation can be managed with WP-CLI (i.e. you can\n    update your plugins with `wp-cli plugin update \u003cplugin\u003e`).\n\nThe installation can (and probably should) be private, meaning it does not need\nto be publicly accessible from outside your system.\n\n## Configuration\n\nWPPR requires a single configuration file. The file should reside inside the\nsame directory as or in a parent directory of the WordPress installation which\nyou installed according to the previous section (_Setup_). This means it should\nbe either located next to `wp-config.php` or in a parent directory above it.\n\nThe configuration file format is [TOML][toml] and in it you defined various\nsettings:\n\n[toml]: https://github.com/toml-lang/toml\n\n-   `binaries`: Which system binaries are used for various operations\n-   `plugins`: The plugins you want to manage with WPPR\n-   `pre_upgrade` Commands to run before running upgrades\n-   `post_upgrade`: Commands to run after running upgrades\n\nThe configuration file can be called anything but this documentation assumes you\nname your configuration files `wppr.toml`.\n\n### Example configuration\n\n    # /path/to/managed/wordpress/wppr.toml\n\n    [binaries]\n    git = \"git\"\n    wpcli = \"/home/johndoe/bin/wp\"\n\n    [git]\n    user_name = \"WPPR System\"\n    user_email = \"wppr@mycompany.com\"\n    force_push = false\n\n    [pre_upgrade]\n    commands = [\n        \"echo 'upgrading!'\"\n    ]\n\n    [post_upgrade]\n    commands = [\n        \"curl https://mycompany.com/some-webhook\",\n        \"echo 'upgraded!'\"\n    ]\n\n    [[plugins]]\n    index_path = \"wp-content/plugins/my-plugin/my-plugin.php\"\n    package_name = \"mycompany/myplugin\"\n    remote_repository = \"git@github.com:mycompany/myplugin-mirror.git\"\n\n    [[plugins]]\n    index_path = \"wp-content/plugins/advanced-custom-fields-pro/acf.php\"\n    package_name = \"mycompany/acf-pro\"\n    remote_repository = \"git@git.mycompany.com:/opt/repositories/acfpro-mirror.git\"\n\n### Configuration values\n\n#### `binaries`\n\nIn this section you define various binaries that are to be used when running\noperations with the tool.\n\n##### `git`\n\nWhich Git executable to use. Can be a `$PATH` accessible binary. Defaults to\n`git`.\n\n##### `wpcli`\n\nWhich WP-CLI executable to use. Can be a `$PATH` accessible binary. Defaults to\n`wp`.\n\n#### `git`\n\nGit configuration.\n\n##### `user_name`\n\nGit user name to use for authoring WPPR commits.\n\n##### `user_email`\n\nGit user email address to use for authoring WPPR commits.\n\n##### `force_push`\n\nWhether to use `force` when pushing plugin changes to remote repositories.\n\n#### `pre_upgrade` and `post_upgrade`\n\n`commands` contains a list of shell commands to run before and after\nrunning the `run` command. Only shell (e.g. Bash) commands are supported.\n\n#### `plugins`\n\nA collection of plugins to manage with WPPR. You can have as many `[[plugins]]`\nsections as you need. One is OK too.\n\n##### `index_file`\n\nRelative path to the plugin's \"index file\", which contains the plugin file\nheader with name, version, description, etc.\n\n##### `package_name`\n\nWhen creating a new Composer package configuration for the plugin, this will\nbe the Composer package name, and to install the mirrored plugin you would use\nthis value as the `require` command value.\n\n##### `remote_repository`\n\nGit-compatible URL to a remote repository to which changes in plugins are\npushed. Your system and user needs to have push rights to this repository.\n\n## Usage\n\nAssuming you have a WordPress installation up and running and you have created\na `wppr.toml` configuration file you can now start using WPPR.\n\nYou can display a generic help message with:\n\n    $ wppr --help\n\n### Listing plugins WPPR is managing\n\n    $ wppr --configuration /path/to/wppr.toml list\n\nThe `list` command lists all the plugins defined in `wppr.toml`. It also tells\nyou whether the defined plugins are valid for management or not.\n\n### Run upgrades, git tags, and git pushes\n\n    $ wppr --configuration /path/to/wppr.toml run\n\nThe `run` command does the real work in this tool.\n\n1.  It first validates the plugins\n2.  It initializes new plugins that have not been managed before\n3.  It creates backups of plugin history and state\n4.  It runs plugins upgrades using WP-CLI\n5.  It checks if anything has changed (files, versions, etc.)\n6.  If there are changes it commits the changes to the plugin Git history and\n    creates a new tag with the value of the plugin's index file's `Version`\n7.  Lastly it pushes the new changes and the Git tag to the configured remote\n    repository.\n\nStep 3 creates a backup, and in case any of the steps after that fail the backup\nis restored to prevent malformed plugins from appearing into your repositories\nlater on.\n\n## Automation with cron triggers\n\nYou can make the plugin \"Composerization\" automatic with cronjobs.\n\nYou can edit your cron configuration with\n\n    $ crontab -e\n\nTo run the tool every hour create the following cronjob:\n\n    0 0 * * * wppr --configuration /path/to/wppr.toml run \u003e /dev/null 2\u003e\u00261\n\nYou can also redirect the cronjob output to a script in case you want to work\nwith it after each run (e.g. send notifications or something):\n\n    0 0 * * * wppr --configuration /path/to/wppr.toml run \u003e /path/to/script.py 2\u003e\u00261\n\nOr if you prefer to just dump the output into a file:\n\n    0 0 * * * wppr --configuration /path/to/wppr.toml run \u003e /home/user/wppr.out 2\u003e\u00261\n\nWith the cron definitions above you should receive automated updates into your\nplugin mirror repositories every hour if there are upgrades available.\n\n## Q\u0026A\n\n#### Does this work with themes as well?\n\nNo. Only plugins are supported at the moment.\n\n#### It does not work with plugin _`plugin name here`_ for some reason!\n\nSome plugins have really twisted upgrade procedures that bypass the regular\nWordPress update procedures. In those cases either the plugin must be managed\nin some other way or then we may be able to introduce a hook to let the plugin\nbe managed.\n\nCreate an issue for the plugin and we can see what to do if anything can be\ndone. Make sure to search first in case someone else has already raised an issue\nabout the plugin.\n\n## Contributing\n\nPull requests, code reviews, issues, ideas, and other support very welcome.\n\nWhen contributing code please follow these guideslines:\n\n-   Maintainers with push rights should follow [_OneFlow_][oneflow], no pushing\n    feature branches unless absolutely necessary\n-   Pull requests should be made against the `master` branch\n-   Format your code with `cargo fmt` (check changes to be made with\n    `cargo fmt -- --write-mode=diff`)\n-   Run tests with `cargo test`\n-   Write tests for new features and changes that you implement, you can check\n    coverage using the steps below\n\n[oneflow]: http://endoflineblog.com/oneflow-a-git-branching-model-and-workflow\n\n### Code coverage\n\n(This section is a bit verbose as coverage testing Rust seems to be a relatively\nnew topic.)\n\nIn addition to `cargo test` this application is code coverage tested using a\nnice little program called [`kcov`][kcov].\n\nProvided in the project root is a script called `coverage.sh` which helps with\ncoverage reporting.\n\nTo generate coverage reports you first need to install `kcov`, and on\nDebian-like Linux systems you can use\n\n    $ ./coverage.sh install\n\nto install it semi-automatically. Pull requests welcome to make it work on other\nsystems as well.\n\nTo generate a coverage report you need to follow these steps:\n\n1.  Build the application using `cargo build`\n2.  Test the code with `RUSTFLAGS='-C link-dead-code' cargo test` (the flag\n    addition ensures we get 0% reporting for code which was not run at all)\n3.  Generate coverage reports with `./coverage.sh run`\n\nAll code inside `./src` (apart from `main.rs`) is coverage reported. You can see\na neat HTML file for your report by opening the `./target/cov/merged/index.html`\nfile in a browser.\n\nTo ignore regions of code from being attempted to be covered you can use the\nfollowing\n\n    //LCOV_EXCL_START\n    ... code to exclude from coverage here ...\n    //LCOV_EXCL_END\n\nTo mark a single line to not be considered for coverage you can use\n\n    let something = something(); //LCOV_EXCL_LINE\n\n**NOTE**: doc-tests cannot be covered with kcov at this time. We need to rely\non the hope that doc-tests actually test the code properly.\n\n[kcov]: https://github.com/SimonKagstrom/kcov\n\n## License\n\nWPPR is licensed with Apache-2.0. See [LICENSE.md][license].\n\n[license]: ./LICENSE.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frask%2Fwppr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frask%2Fwppr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frask%2Fwppr/lists"}