58% simple-cloudflare-turnstile

Code Review | Simple Cloudflare Turnstile - CAPTCHA Alternative

WordPress plugin Simple Cloudflare Turnstile - CAPTCHA Alternative scored58%from 54 tests.

About plugin

  • Plugin page: simple-cloudflare...
  • Plugin version: 1.25.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.4.0
  • WordPress version: 6.3.1
  • First release: Oct 15, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 183
  • Update frequency: every 2.1 days
  • Top authors: Elliotvs (100%)

Code review

54 tests

User reviews

90 reviews

Install metrics

20,000+ active /239,155 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼3.05ms] Passed 4 tests

Server-side resources used by Simple Cloudflare Turnstile - CAPTCHA Alternative
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2543.36 ▲1.14
Dashboard /wp-admin3.56 ▲0.2148.58 ▼7.57
Posts /wp-admin/edit.php3.61 ▲0.2552.06 ▲0.51
Add New Post /wp-admin/post-new.php6.14 ▲0.2595.14 ▼4.75
Media Library /wp-admin/upload.php3.48 ▲0.2536.00 ▼0.39
Cloudflare Turnstile /wp-admin/options-general.php?page=cfturnstile3.4639.98

Server storage [IO: ▲0.19MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
cfturnstile_tested

Browser metrics Passed 4 tests

Simple Cloudflare Turnstile - CAPTCHA Alternative: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲714.14 ▼0.221.79 ▼0.2043.15 ▼2.08
Dashboard /wp-admin2,196 ▲165.58 ▼0.1097.64 ▼3.4141.97 ▲3.67
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0439.08 ▼0.8937.60 ▲4.43
Add New Post /wp-admin/post-new.php1,538 ▲325.13 ▲2.09637.78 ▼56.3367.29 ▲12.90
Media Library /wp-admin/upload.php1,404 ▲74.25 ▲0.09101.02 ▼6.9342.98 ▲0.96
Cloudflare Turnstile /wp-admin/options-general.php?page=cfturnstile1,5101.7528.7880.82

Uninstaller [IO: ▲0.19MB] [DB: ▲0.00MB] 25% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Compile error in wp-content/plugins/simple-cloudflare-turnstile/inc/admin/register-settings.php+9
    Cannot redeclare cfturnstile_register_settings() (previously declared in wp-content/plugins/simple-cloudflare-turnstile/inc/admin/register-settings.php:10)
  • Uninstaller has failed for this plugin, leaving 35 files (0.19MB) in the plugin directory
    • (new file) css/admin-style.css
    • (new file) inc/errors.php
    • (new file) inc/integrations/ecommerce/pmp.php
    • (new file) inc/admin/admin-options.php
    • (new file) css/cfturnstile.css
    • (new file) inc/admin/register-settings.php
    • (new file) inc/integrations/community/buddypress.php
    • (new file) inc/integrations/community/bbpress.php
    • (new file) inc/integrations/ecommerce/edd.php
    • (new file) inc/integrations/community/wpdiscuz.php
    • ...
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • cfturnstile_tested
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-cloudflare-turnstile/simple-cloudflare-turnstile.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=cfturnstile
    • > Console-api (warning) in unknown
    https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&ver=6.3.1 0:7101 "[Cloudflare Turnstile] Unknown parameter passed to api.js: \"?ver=...\", ignoring."

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: spam, captcha, protect, cloudflare, turnstile

simple-cloudflare-turnstile/simple-cloudflare-turnstile.php 92% from 13 tests

The principal PHP file in "Simple Cloudflare Turnstile - CAPTCHA Alternative" v. 1.25.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "3.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin3,217 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP284863512,891
JavaScript4021179
CSS2180147

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions109
▷ Named functions10798.17%
▷ Anonymous functions21.83%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin