Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello Danny!
I'm Maxim Akimov, a WordPress plugin developer. I collaborate with the Prosopo team and I am responsible for the integration with your plugin. (here is the related WP support thread)
After getting familiar with the plugin architecture, I have done the following:
Let me briefly explain the reasons behind the key decisions:
1. New integration
I opted for the new integration as it allows us to keep the vast of the integration code independent, without changing the core code.
Making all the Procaptcha settings part of the general settings would stretch them and could distract users while adding as part of form settings would require filling the same data multiple times.
The added 'Procaptcha status' to the general settings simplifies the navigation while keeping the settings short.
2. Procaptcha field type
I opted for the button, as unlike auto-injection it allows users not just to enable or disable the captcha for specific forms, but also precisely control its position in the form.
Meanwhile, the field button uses the existing setup and just adds a hidden input. This input is replaced with the real captcha element during rendering.
It allowed me to avoid big changes in the JS code while having a captcha element dynamic. It means if in the future we've something to change or improve in the element, we won't have the compatibility issue, as it would be in the case with the static HTML.
For the new and modified code, I setup IDE with CodeSniffer to follow your phpcs.xml rules.
Please review the PR, and let me know if you've any notes or concerns. I'm also open to changing the chosen integration approach, in case you don't like it.
Best regards,
Maxim