https://github.com/cba85/wp-updater
Wordpress native updater for custom plugin system
https://github.com/cba85/wp-updater
Last synced: about 1 month ago
JSON representation
Wordpress native updater for custom plugin system
- Host: GitHub
- URL: https://github.com/cba85/wp-updater
- Owner: cba85
- Created: 2019-10-10T07:30:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-26T14:11:27.000Z (about 5 years ago)
- Last Synced: 2025-01-15T07:05:54.673Z (over 1 year ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WP Updater
This package has been created to integrate WordPress core updates with your custom plugin.
This Wordpress package is based on [Misha Rudrastyh article: Self-Hosted Plugin Updates](https://rudrastyh.com/wordpress/self-hosted-plugin-update.html).
This package is a simple class organized using [traits](https://www.php.net/manual/en/language.oop5.traits.php).
## Tests
```
$ ./vendor/bin/phpunit
```
### Wordpress spies
To test the package which call some Wordpress functions, I've created spies functions to simulate them outside a Wordpress environment.
These functions are located in `/tests/spies/wordpress.php`.
#### Transient
`get_transient()` in `/tests/spies/wordpress.php` simulate a transient retrievement by default. Uncomment the first line to test a remote retrievement.
You have to update tests by commenting/uncommenting some lines in `TransientTest.php` and `UpdateTest.php` files depending on the remote or transient information retrievement.