84% formcraft-recaptcha

Code Review | reCaptcha Add-On for FormCraft

WordPress plugin reCaptcha Add-On for FormCraft scored84%from 54 tests.

About plugin

  • Plugin page: formcraft-recaptcha
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.5
  • WordPress version: 6.3.1
  • First release: Jun 6, 2015
  • Latest release: Nov 19, 2020
  • Number of updates: 12
  • Update frequency: every 166.2 days
  • Top authors: nish@ncrafts.net (100%)

Code review

54 tests

User reviews

1 review

Install metrics

6,000+ active /41,975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.24ms] Passed 4 tests

This is a short check of server-side resources used by reCaptcha Add-On for FormCraft
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.93 ▲2.13
Dashboard /wp-admin3.32 ▲0.0257.07 ▲5.22
Posts /wp-admin/edit.php3.37 ▲0.0252.82 ▲0.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.12 ▼13.88
Media Library /wp-admin/upload.php3.25 ▲0.0236.32 ▼1.51

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for reCaptcha Add-On for FormCraft
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.38 ▲0.011.97 ▲0.0746.59 ▲5.29
Dashboard /wp-admin2,195 ▲185.52 ▼0.1582.93 ▼7.3540.48 ▼3.07
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0438.38 ▲1.6335.08 ▲0.89
Add New Post /wp-admin/post-new.php1,526 ▼1917.49 ▼5.78690.32 ▲73.4462.29 ▲4.27
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.0296.50 ▼8.9344.04 ▼6.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/formcraft-recaptcha/formcraft-captcha.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt is a good inspiration

formcraft-recaptcha/formcraft-captcha.php 92% from 13 tests

This is the main PHP file of "reCaptcha Add-On for FormCraft" version 1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("formcraft-recaptcha.php" instead of "formcraft-captcha.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected141 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111473
JavaScript22046
CSS10022

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo.png3.47KB2.31KB▼ 33.55%
sample-captcha.png9.78KB9.98KB0.00%