84% 2bc-form-security

Code Review | 2BC Form Security

WordPress plugin 2BC Form Security scored84%from 54 tests.

About plugin

  • Plugin page: 2bc-form-security
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.2.2
  • WordPress version: 6.3.1
  • First release: Apr 8, 2015
  • Latest release: May 7, 2015
  • Number of updates: 11
  • Update frequency: every 2.7 days
  • Top authors: 2bc_jason (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,775 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.35MB] [CPU: ▼0.31ms] Passed 4 tests

A check of server-side resources used by 2BC Form Security
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3346.11 ▲0.44
Dashboard /wp-admin49.54 ▲46.159,537,312.48 ▲9,537,245.09
Posts /wp-admin/edit.php3.80 ▲0.4057.35 ▼1.24
Add New Post /wp-admin/post-new.php6.27 ▲0.34100.13 ▼6.38
Media Library /wp-admin/upload.php3.61 ▲0.3443.11 ▲5.93
2BC Form Security /wp-admin/options-general.php?page=twobc_formsecurity3.5840.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 17 new files
Database: 1 new table, 7 new options
New tables
wp_twobc_formsecurity_log
New WordPress options
can_compress_scripts
widget_recent-posts
twobc_formsecurity_options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by 2BC Form Security
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20214.35 ▲0.001.58 ▼0.2433.62 ▼10.33
Dashboard /wp-admin2,359 ▲1855.67 ▲0.0997.18 ▼5.4946.04 ▼1.72
Posts /wp-admin/edit.php2,118 ▲181.98 ▲0.0343.21 ▲4.7836.54 ▲3.34
Add New Post /wp-admin/post-new.php1,539 ▲1123.10 ▲0.13681.69 ▼42.1156.41 ▼2.09
Media Library /wp-admin/upload.php1,417 ▲174.17 ▲0.1097.43 ▼7.6842.50 ▼3.64
2BC Form Security /wp-admin/options-general.php?page=twobc_formsecurity1,0902.5038.1834.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=twobc_formsecurity
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=twobc_formsecurity
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (17 tag instead of maximum 10)
Please take inspiration from this readme.txt

2bc-form-security/2bc-form-security.php Passed 13 tests

The principal PHP file in "2BC Form Security" v. 2.0.1 is loaded by WordPress automatically on each request
134 characters long description:
Increase security and reduce spam by adding a honeypot and Google reCAPTCHA V2 to the log in form, registration form, and comment form

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin2,738 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP44036771,954
PO File1102103291
CSS2379285
JavaScript191208

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 125)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity165.50
▷ Minimum class complexity125.00
▷ Maximum class complexity206.00
Average method complexity6.77
▷ Minimum method complexity1.00
▷ Maximum method complexity125.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods57
▷ Static methods5291.23%
▷ Public methods4375.44%
▷ Protected methods00.00%
▷ Private methods1424.56%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/buddypress.png1.40KB1.20KB▼ 14.25%