{"id":19045468,"url":"https://github.com/yoast/whip","last_synced_at":"2025-05-16T11:04:53.274Z","repository":{"id":17530845,"uuid":"82176705","full_name":"Yoast/whip","owner":"Yoast","description":"A WordPress package to nudge users to upgrade their software versions (starting with PHP)","archived":false,"fork":false,"pushed_at":"2025-03-20T07:50:27.000Z","size":1035,"stargazers_count":71,"open_issues_count":9,"forks_count":8,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-16T11:04:46.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yoast.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-02-16T12:08:29.000Z","updated_at":"2025-03-20T07:50:30.000Z","dependencies_parsed_at":"2023-12-27T08:33:43.874Z","dependency_job_id":"243e26c3-febb-4204-8293-fc2e314cac04","html_url":"https://github.com/Yoast/whip","commit_stats":{"total_commits":288,"total_committers":13,"mean_commits":"22.153846153846153","dds":0.5659722222222222,"last_synced_commit":"ea52c34195d1c70a0f6bad0b8c03dcea42108c60"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2Fwhip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2Fwhip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2Fwhip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2Fwhip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yoast","download_url":"https://codeload.github.com/Yoast/whip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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":[],"created_at":"2024-11-08T22:50:18.518Z","updated_at":"2025-05-16T11:04:48.259Z","avatar_url":"https://github.com/Yoast.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CS](https://github.com/Yoast/whip/actions/workflows/cs.yml/badge.svg)](https://github.com/Yoast/whip/actions/workflows/cs.yml)\n[![Test](https://github.com/Yoast/whip/actions/workflows/test.yml/badge.svg)](https://github.com/Yoast/whip/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Yoast/whip/badge.svg?branch=main)](https://coveralls.io/github/Yoast/whip?branch=main)\n\n# whip\nA WordPress package to nudge users to upgrade their software versions (starting with PHP)\n\n![Screenshot of the WordPress notice](./images/wp-message.png)\n\n## Requirements\n\nAll the PHP versions from 5.3 up to the latest are supported.\n\nWordPress is also required for certain functionality:\n\n* The `WPMessagePresenter` requires WordPress or a function called `add_action`, to hook into WordPress.\n* The `PHPVersionDetector` requires WordPress or a function called `__`, to translate strings.\n\n## Installation\n\n```bash\n$ composer require yoast/whip \n```\n\n## Usage\n\nThe easiest way to use Whip in WordPress is by using the included function to check the versions. In this case checking if PHP 5.6 or greater is installed: \n```php\nwhip_wp_check_versions( array(\n\t'php' =\u003e '\u003e=5.6',\n) );\n```\n\nThis will show a message to all users of your plugin on PHP 5.3 to PHP 5.5. By default the message will be shown on every page of the admin and to every user. It is up to the implementing plugin to restrict this to certain users and/or pages.\n\n### Adding a message as a host\n\nIt is possible to add a custom message to the PHP version message by setting specific environment variables:\n\n```php\nputenv( \"WHIP_NAME_OF_HOST=Name of the host\" );\nputenv( \"WHIP_MESSAGE_FROM_HOST_ABOUT_PHP=A message from the host\" );\n```\n\nThe `WHIP_NAME_OF_HOST` environment variable could be reused in the future for showing messages about different software packages.\n\nBoth the name and the message for PHP can also be changed using WordPress filters:\n```php\nfunction my_host__name_for_whip() {\n\treturn 'Name of the host';\n}\nadd_filter( 'whip_name_of_host', 'my_host__name_for_whip' );\n\nfunction my_host__php_message_for_whip( $message ) {\n\treturn 'A message from the host';\n}\nadd_filter( 'whip_message_from_host_about_php', 'my_host__php_message_for_whip' );\n```\n\nThe WordPress filters can also read the value previously set by the environment variables.\n\nAs a general rule, the filter is the same as the environment variable, but lowercased.\n\n### Linking to the WordPress.org hosting page\n\nWe have created a hosting overview page on yoast.com which only contains hosts that we've vetted. The PHP message links to this page by default. If you really prefer to link to the WordPress.org hosting page that is possible. Just use the `whip_hosting_page_url_wordpress` filter:\n\n```php\nadd_filter( 'whip_hosting_page_url_wordpress', '__return_true' );\n```\n\n## Backwards compatibility policy\n\nWe follow [semantic versioning][semver] with an extra strict rule for MAJOR versions. We will do a major version bump whenever we add new methods. We have to do this because of the shared namespace in PHP. When this package will be used in multiple plugins we cannot safely add and use a method without bumping a major version. This is because the version without the new method may be autoloaded and then a fatal error occurs.\n\nThis also means that any major version bump is accompanied by an update of every namespace in the package. So for version 3 of this package all the `Yoast\\WHIPv2` namespaces will become `Yoast\\WHIPv3`. This prevents fatal errors when two plugins include different versions of this package.\n\n## Changelog\n\n\n## Security\n\nIf you discover any security related issues, please email security@yoast.com instead of using the issue tracker.\n\n## Credits\n\n* [Team Yoast](https://github.com/yoast)\n\n\n[semver]: http://semver.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoast%2Fwhip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoast%2Fwhip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoast%2Fwhip/lists"}