{"id":14955120,"url":"https://github.com/bdbch/vivalidator","last_synced_at":"2026-02-18T19:32:13.017Z","repository":{"id":47862285,"uuid":"146521455","full_name":"bdbch/vivalidator","owner":"bdbch","description":"Simple and easy data validation for forms","archived":false,"fork":false,"pushed_at":"2021-08-12T08:46:03.000Z","size":46,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T14:43:14.141Z","etag":null,"topics":["feature","flynt","flyntwp","forms","php","validation","wordpress"],"latest_commit_sha":null,"homepage":"","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/bdbch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-29T00:15:32.000Z","updated_at":"2021-08-12T08:46:04.000Z","dependencies_parsed_at":"2022-09-14T09:51:08.912Z","dependency_job_id":null,"html_url":"https://github.com/bdbch/vivalidator","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/bdbch/vivalidator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fvivalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fvivalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fvivalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fvivalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdbch","download_url":"https://codeload.github.com/bdbch/vivalidator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fvivalidator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29591933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T18:54:29.675Z","status":"ssl_error","status_checked_at":"2026-02-18T18:50:50.517Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["feature","flynt","flyntwp","forms","php","validation","wordpress"],"created_at":"2024-09-24T13:10:32.913Z","updated_at":"2026-02-18T19:32:12.980Z","avatar_url":"https://github.com/bdbch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Screenshot of a form validated with Vivalidator](screenshot.png)\r\n\r\n# Vivalidator\r\n\r\n\u003e A simple and easy input and data validation library\r\n\r\n## Why?\r\n\r\nI dislike the way of using Wordpress Plugins or heavy PHP packages for form development when it comes to Wordpress forms. I hate when third party code adds markup to your page or narrows my possibilites because of some restrictions coming with the external code. Thats why I started looking for easy to use validation frameworks but didn't find anything that perfectly fits my needs. This is why I started development on Vivalidator.\r\n\r\n## Installation\r\n\r\n#### The Composer Way\r\n\r\nRun `composer require bdbch/vivalidator` in your project folder to install Vivalidator via Composer. It will be automatically placed into your autoload.\r\n\r\n#### Manual Way\r\n\r\nMake sure to have all necessary files copied manually into your project. Require the desired library from the `src` folder in your code to get access to a Vivalidator Class.\r\n\r\n## Usage\r\n\r\nUsing the Validator is simple. Check out this example code to get an idea on how to use this feature.\r\n\r\n```php\r\n\u003c?php\r\n\r\n// Make sure to use the feature in your component\r\nuse Vivalidator\\Validator;\r\n\r\n// Data to validate. I left the job empty on purpose to demonstrate non-valid data\r\n$data = [\r\n  'name' =\u003e 'Peter',\r\n  'age' =\u003e '23',\r\n  'job' =\u003e ''\r\n];\r\n\r\n// Validator Options / Rules\r\n// Each field can have multiple rules with their own error messages\r\n$options = [\r\n  'name' =\u003e [\r\n    [\r\n      'rule' =\u003e 'required',\r\n      'error' =\u003e 'Please enter your name'\r\n    ],\r\n    [\r\n      'rule' =\u003e 'minlength',\r\n      'value' =\u003e 3,\r\n      'error' =\u003e 'Your name needs to be longer than 3 characters.'\r\n    ]\r\n  ],\r\n  'age' =\u003e [\r\n    [\r\n      'rule' =\u003e 'required',\r\n      'error' =\u003e 'Please enter your age'\r\n    ],\r\n    [\r\n      'rule' =\u003e 'min',\r\n      'value' =\u003e 1,\r\n      'error' =\u003e 'You need to be older than 1'\r\n    ],\r\n    [\r\n      'rule' =\u003e 'max',\r\n      'value' =\u003e 150,\r\n      'error' =\u003e 'I would love to believe you, but I will not'\r\n    ]\r\n  ],\r\n  'job' =\u003e [\r\n    [\r\n      'rule' =\u003e 'required',\r\n      'error' =\u003e 'Please specify your job'\r\n    ]\r\n  ]\r\n];\r\n\r\n// Create a new validator instance and pass data and options in\r\n$validator = new Validator($data, $options);\r\n\r\n// Errors will be collected in an array.\r\n// If there are no errors, it will be an empty string\r\nif (count($validator-\u003eerrors)) {\r\n  echo 'You have ' . count($validator-\u003eerrors) . ' errors in your submission.';\r\n  foreach ($validator-\u003eerrors as $error) {\r\n    echo 'Error: ' . $error;\r\n  }\r\n} else {\r\n  echo 'All set, lets submit!';\r\n}\r\n\r\n// Thats it\r\n// You can now do what ever you want with the submitted data\r\n// Make sure to escape the data. The validator doesn't do this right now\r\n// TODO: This will be a feature so fields can be escaped if needed\r\n```\r\n\r\n## Adding ReCaptcha\r\n\r\nVivalidator now has ReCaptcha Support! Just specify your Secret Key and the Error String as extra data to configure it right away! Make sure to have the ReCaptcha library installed manually or via `composer require google/recaptcha`.\r\n\r\n```php\r\n// Check this URL if you need a Key\r\n// https://www.google.com/recaptcha/admin\r\n// Make sure you have a working ReCaptcha library installed,\r\n// otherwise this will do nothing\r\n$validator = new Validator($data, $options, [\r\n  'recaptcha' =\u003e [\r\n    'secret' =\u003e 'YOUR_SECRET_KEY_HERE',\r\n    'error' =\u003e 'Please verify our captcha'\r\n  ]\r\n]);\r\n```\r\n\r\n## Rules\r\n\r\n* `required` - Checks if the input is not empty\r\n* `minlength` - Checks if the input is longer than a specific value\r\n* `maxlength` - Checks if the input is lower than a specific value\r\n* `email` - Checks if the input is a valid email\r\n* `url` - Checks if the input is an URL\r\n* `number` - Checks if the input is a number\r\n* `min` - Checks if the input is higher than the defined value\r\n* `max` - Checks if the input is lower than the defined value\r\n* `between` - Checks if the input is between two numbers (combination of max and min)\r\n* `regex` - Checks if the input matches a specified regex\r\n\r\n#### Planned Rules\r\nSee [this issue](https://github.com/bdbch/flynt-validator/issues/1) to learn more\r\n\r\n## Contribution\r\n\r\nI'm open for pull requests and would love to see some support. I'm not the 100% best PHP developer and would love to get this Flynt feature even better so we're not bound to damn Wordpress Plugins anymore.\r\n\r\n## License\r\n\r\nThis is licensed under the MIT license.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdbch%2Fvivalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdbch%2Fvivalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdbch%2Fvivalidator/lists"}