{"id":15292239,"url":"https://github.com/ssteele/wp-typesanity","last_synced_at":"2026-02-15T17:01:42.457Z","repository":{"id":57058771,"uuid":"126739722","full_name":"ssteele/wp-typesanity","owner":"ssteele","description":"WordPress user input sanitizer","archived":false,"fork":false,"pushed_at":"2024-12-29T03:15:32.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T10:32:20.741Z","etag":null,"topics":["input","sanitize","wordpress-plugin"],"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/ssteele.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-03-25T20:59:17.000Z","updated_at":"2025-09-25T08:27:46.000Z","dependencies_parsed_at":"2025-10-12T10:31:47.354Z","dependency_job_id":"3385b06d-f922-44a2-9945-3811583b1395","html_url":"https://github.com/ssteele/wp-typesanity","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ssteele/wp-typesanity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteele%2Fwp-typesanity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteele%2Fwp-typesanity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteele%2Fwp-typesanity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteele%2Fwp-typesanity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssteele","download_url":"https://codeload.github.com/ssteele/wp-typesanity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssteele%2Fwp-typesanity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29484955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T15:33:17.885Z","status":"ssl_error","status_checked_at":"2026-02-15T15:32:53.698Z","response_time":118,"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":["input","sanitize","wordpress-plugin"],"created_at":"2024-09-30T16:17:03.542Z","updated_at":"2026-02-15T17:01:42.412Z","avatar_url":"https://github.com/ssteele.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## WP Typesanity\n\n*A WordPress plugin that sanitizes user input by unit type*\n\n### Description\n\nWP Typesanity delivers a consistent experience when dealing with the various base PHP unit types in the WordPress environment. All input is stringified and filtered through `wp_kses` to remove markup and \"evil scripts\". You can pass a second parameter to `sanitize` to specify an expected unit type. Strings, integers, and floats are verified and expected data is kept. Unexpected data is set to an empty string. Now you are free to develop as fast as you like knowing the unit types you're dealing with are what you expect. See table below for a breakdown of unit type expectations:\n\n| input   | string   | integer | float   |\n| ------- | -------- | ------- | ------- |\n| 'foo'   | 'foo'    | ''      | ''      |\n| '1'     | '1'      | '1'     | '1'     |\n| '0'     | '0'      | '0'     | '0'     |\n| '1.2'   | '1.2'    | '1'     | '1.2'   |\n| '0.0'   | '0.0'    | '0'     | '0.0'   |\n| 'true'  | 'true'   | ''      | ''      |\n| 'false' | 'false'  | ''      | ''      |\n| 1       | '1'      | '1'     | '1'     |\n| 0       | '0'      | '0'     | '0'     |\n| 1.2     | '1.2'    | '1'     | '1.2'   |\n| 0.0     | '0.0'    | '0'     | '0.0'   |\n| true    | 'true'   | ''      | ''      |\n| false   | 'false'  | ''      | ''      |\n\n### Setup\n\nNavigate to your plugin via the terminal and issue:\n\n`composer require ssteele/wp-typesanity`\n\n### Documentation\n\nSanitize user input:\n\n    $translator = new UserInput();\n    $_POST = [\n        'name' =\u003e 'Steve Steele',\n        'id'   =\u003e 1,\n        'gpa'  =\u003e 3.9,\n    ];\n    $name = $translator-\u003esanitize($_POST['name']);          // sanitize name\n\nPass in optional parameter [s]tring, [i]nteger, or [f]loat to ensure proper data type:\n\n    $name = $translator-\u003esanitize($_POST['name'], 's');     // sanitize name as string\n    $id = $translator-\u003esanitize($_POST['id'], 'i');         // sanitize id as integer\n    $gpa = $translator-\u003esanitize($_POST['gpa'], 'f');       // sanitize gpa as float\n\nBulk sanitize an array of user input:\n\n    $post = $translator-\u003esanitize($_POST);                  // sanitize all post elements\n    $post = $translator-\u003esanitize($_POST, 'i');             // sanitize all post elements as integer\n    $post = $translator-\u003esanitize($_POST, ['s', 'i', 'f']); // sanitize all post elements (of known order) against respective types\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssteele%2Fwp-typesanity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssteele%2Fwp-typesanity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssteele%2Fwp-typesanity/lists"}