10% smart-recaptcha

Code Review | Smart Captcha (reCAPTCHA)

WordPress plugin Smart Captcha (reCAPTCHA) scored10%from 54 tests.

About plugin

  • Plugin page: smart-recaptcha
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9.1
  • WordPress version: 6.3.1
  • First release: May 23, 2018
  • Latest release: May 23, 2018
  • Number of updates: 10
  • Update frequency: N/A
  • Top authors: phpinterviewquestion.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /678 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/smart-recaptcha/smtcptc-contact-form-integration.php+15
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.10ms] Passed 4 tests

An overview of server-side resources used by Smart Captcha (reCAPTCHA)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.04 ▲1.39
Dashboard /wp-admin3.33 ▲0.0350.02 ▲1.08
Posts /wp-admin/edit.php3.38 ▲0.0348.13 ▼5.48
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.76 ▼20.18
Media Library /wp-admin/upload.php3.26 ▲0.0334.36 ▲0.20

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
smt_cptch_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Captcha (reCAPTCHA)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7513.35 ▼1.271.71 ▼0.3844.27 ▲4.71
Dashboard /wp-admin2,227 ▲425.90 ▲0.05101.29 ▲1.5339.86 ▼4.77
Posts /wp-admin/edit.php2,113 ▲242.10 ▲0.1035.99 ▼3.7232.79 ▼2.57
Add New Post /wp-admin/post-new.php1,535 ▲523.14 ▲4.83595.59 ▼23.0777.01 ▲27.30
Media Library /wp-admin/upload.php1,412 ▲244.25 ▲0.0699.29 ▲2.0643.67 ▲1.68

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smart-recaptcha/smtcptc-contact-form-integration.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-recaptcha/recaptcha.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-recaptcha/re_menu/re_functions.php:261

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Login form with Smart Captcha (reCAPTCHA).), #2 (Registration form with Smart Captcha (reCAPTCHA).), #3 (Lost password form with Smart Captcha (reCAPTCHA).), #4 (Comments form with Smart Captcha (reCAPTCHA).), #5 (Contact Form 7 with Smart Captcha (reCAPTCHA).), #6 (Smart Captcha (reCAPTCHA) Settings page.)
Please take inspiration from this readme.txt

smart-recaptcha/recaptcha.php 85% from 13 tests

The main PHP script in "Smart Captcha (reCAPTCHA)" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smart-recaptcha.php" instead of "recaptcha.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected8,414 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PO File92,4673,9184,313
PHP75,5364862,077
CSS72,023731,616
JavaScript518272336
SVG10072

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity41.50
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity6.79
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods214.29%
▷ Protected methods00.00%
▷ Private methods1285.71%
Functions83
▷ Named functions83100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.93MB with 0.57MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-7.png121.66KB39.31KB▼ 67.69%
screenshot-6.png51.92KB22.73KB▼ 56.23%
screenshot-3.png24.21KB10.56KB▼ 56.39%
screenshot-5.png69.28KB31.80KB▼ 54.09%
screenshot-10.png362.91KB109.36KB▼ 69.87%