{"id":18499309,"url":"https://github.com/isometriks/isometriksspambundle","last_synced_at":"2025-04-09T23:21:12.755Z","repository":{"id":9447295,"uuid":"11325336","full_name":"isometriks/IsometriksSpamBundle","owner":"isometriks","description":"Symfony Form Spam Protection","archived":false,"fork":false,"pushed_at":"2024-05-29T12:43:05.000Z","size":53,"stargazers_count":45,"open_issues_count":10,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-09-20T13:07:21.884Z","etag":null,"topics":["honeypot","php","spam","spam-prevention","symfony-bundle"],"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/isometriks.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}},"created_at":"2013-07-10T21:39:16.000Z","updated_at":"2024-05-29T12:43:09.000Z","dependencies_parsed_at":"2023-01-13T15:21:49.592Z","dependency_job_id":"b89edd76-04ae-4670-b61d-413e672d5801","html_url":"https://github.com/isometriks/IsometriksSpamBundle","commit_stats":{"total_commits":37,"total_committers":7,"mean_commits":5.285714285714286,"dds":"0.18918918918918914","last_synced_commit":"493622c3408a7839d10d676e00706c2d6549f5d5"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometriks%2FIsometriksSpamBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometriks%2FIsometriksSpamBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometriks%2FIsometriksSpamBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isometriks%2FIsometriksSpamBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isometriks","download_url":"https://codeload.github.com/isometriks/IsometriksSpamBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126363,"owners_count":21051910,"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":["honeypot","php","spam","spam-prevention","symfony-bundle"],"created_at":"2024-11-06T13:45:24.640Z","updated_at":"2025-04-09T23:21:12.722Z","avatar_url":"https://github.com/isometriks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony SpamBundle\n\nPlease feel free to send pull requests. I would like to incorporate a bunch of\nspam methods into this project.\n\n### Installation\n\nInstall via Composer:\n\n```shell\n$ composer require isometriks/spam-bundle\n```\n\nIf you're not using Symfony Flex, add the bundle to your `config/bundles.php` file:\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    Isometriks\\Bundle\\SpamBundle\\IsometriksSpamBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\nCurrently we have:\n\n### Timed Spam Prevention\n\nRequires forms to be sent after a certain amount of time. Most bots won't wait\nto submit your forms, so requiring an amount of time between render and submit\ncan help deter these bots.\n\n*A side affect of this spam prevention is that you won't be able to refresh\na page to resubmit data UNLESS the view is rendered again `$form-\u003ecreateView()`\nThis is because the event listener removes the start time of the form and\nwhen it can't find it, will cause the form to be invalid. You could set your\nmin time to 0 to just make use of this feature*\n\n*Also note that this spam protection will also apply this limit to forms that\nare not filled in correctly and need to be resubmitted. A high minimum time \ncould affect those users who only need to fix one field quickly*\n\nConfiguration:\n\n```YAML\n# config/packages/isometriks_spam.yaml\n\n# Copying this config is not necessary. These are defaults, only copy \n# what you'd like to change. \nisometriks_spam:\n    timed:\n        min: 7 # seconds\n        max: 3600\n        global: false\n        # message also takes translator strings.\n        message: You're doing that too quickly.\n```\n\nUsage:\n\n```php\n$this-\u003ecreateForm(MyType:class, null, [\n    'timed_spam' =\u003e true, // Just this line is required to enable this feature, the rest is to override settings\n    'timed_spam_min' =\u003e 3,\n    'timed_spam_max' =\u003e 40,\n    'timed_spam_message' =\u003e 'Please wait 3 seconds before submitting',\n]);\n```\n\nOr\n\n```php\npublic function configureOptions(OptionsResolver $resolver)\n{\n    $resolver-\u003esetDefaults([\n        'timed_spam' =\u003e true,\n        // ...\n    ]);\n}\n```\n\n### Honeypot Spam Prevention\n\nA honeypot is a way to trick bots into filling out a field that should not\nbe filled out. It is hidden and can be named something usual so that any\nbots / crawlers will think it is a real field.\n\nIf the field is filled out, then the form is invalid. You can optionally\nchoose to use a class name to hide the form element as well in case the\nbot tries to check the style attribute.\n\n```yml\n# Copying this config is not necessary. These are defaults, only copy \n# what you'd like to change. \nisometriks_spam:\n    honeypot:\n        field: email_address\n        use_class: false\n        hide_class: hidden\n        global: false\n        message: Form fields are invalid\n```\n\nUsage:\n\n```php\n// Only honeypot = true is required to enable, the rest are to override settings\n$this-\u003ecreateForm(MyType::class, null, [\n    'honeypot' =\u003e true,\n    'honeypot_field' =\u003e 'email_address',\n    'honeypot_use_class' =\u003e false,\n    'honeypot_hide_class' =\u003e 'hidden',\n    'honeypot_message' =\u003e 'Form fields are invalid',\n]);\n```\n\nOr\n\n```php\npublic function configureOptions(OptionsResolver $resolver)\n{\n    $resolver-\u003esetDefaults([\n        'honeypot' =\u003e true,\n        // ...\n    ]);\n}\n```\n\n### Twig Form Error Message Rendering\n\nForm errors come from the form itself, so if you want to display the errors\nyou'll need to make sure this is in your template.\n\n```twig\n{% if form.vars.errors is not empty %}\n    {{ form_errors(form) }}\n{% endif %}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisometriks%2Fisometriksspambundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisometriks%2Fisometriksspambundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisometriks%2Fisometriksspambundle/lists"}