78% wp-security-txt

Code Review | wp-security-txt

WordPress plugin wp-security-txt scored78%from 54 tests.

About plugin

  • Plugin page: wp-security-txt
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9
  • WordPress version: 6.3.1
  • First release: Nov 22, 2017
  • Latest release: Nov 23, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: securitytxt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,166 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼0.41ms] Passed 4 tests

Analyzing server-side resources used by wp-security-txt
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.51 ▼3.74
Dashboard /wp-admin3.37 ▲0.0749.47 ▼0.31
Posts /wp-admin/edit.php3.43 ▲0.0752.34 ▲5.80
Add New Post /wp-admin/post-new.php5.95 ▲0.0788.37 ▼2.20
Media Library /wp-admin/upload.php3.30 ▲0.0737.08 ▲4.59
security.txt /wp-admin/options-general.php?page=wordpress-security-txt3.3536.12

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

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

Browser metrics Passed 4 tests

wp-security-txt: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.22 ▼1.171.71 ▼0.0541.36 ▼6.76
Dashboard /wp-admin2,227 ▲395.82 ▲0.9399.92 ▼16.2639.68 ▼5.95
Posts /wp-admin/edit.php2,110 ▲212.04 ▲0.0239.75 ▲0.5235.56 ▲2.50
Add New Post /wp-admin/post-new.php1,528 ▲1417.73 ▲0.29672.58 ▼7.1754.82 ▲2.47
Media Library /wp-admin/upload.php1,403 ▲154.28 ▲0.0898.78 ▲4.0743.21 ▼1.30
security.txt /wp-admin/options-general.php?page=wordpress-security-txt1,3022.5560.7642.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • wordpress-security-txt-options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-section-directives.php
    • > /wp-content/plugins/wp-security-txt/public/partials/wordpress-security-txt-public-display.php
    • > /wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-section-general.php
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-field-select.php:23
    • > PHP Warning
      Use of undefined constant DB_HOST - assumed 'DB_HOST' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-section-debug.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'WordPress_Security_Txt_Admin' not found in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-section-debug.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-field-repeater.php:30
    • > PHP Notice
      Undefined variable: setatts in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-field-repeater.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-field-text.php:19
    • > PHP Warning
      Use of undefined constant WORDPRESS_SECURITY_TXT_VERSION - assumed 'WORDPRESS_SECURITY_TXT_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-page-help.php on line 29
    • > PHP Notice
      Undefined variable: count in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-field-repeater.php on line 23
    • > PHP Fatal error
      Uncaught Error: Interface 'AustinHeap\\Security\\Txt\\SecurityTxtInterface' not found in wp-content/plugins/wp-security-txt/lib/src/SecurityTxt.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-security-txt/admin/partials/wordpress-security-txt-page-help.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: security, netsec, infosec, responsible disclosure, securitytxt...

wp-security-txt/wordpress-security-txt.php 85% from 13 tests

The entry point to "wp-security-txt" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-security-txt.php" instead of "wordpress-security-txt.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected3,262 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PHP344531,5871,802
PO File17425595952
JavaScript46427176
Sass1230137
CSS161105
Markdown326090

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity10.06
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces2
Interfaces1
Traits4
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods132
▷ Static methods118.33%
▷ Public methods11486.36%
▷ Protected methods00.00%
▷ Private methods1813.64%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin