94% barbwire-security

Code Review | Barbwire Security

WordPress plugin Barbwire Security scored 94% from 54 tests.

About plugin

  • Plugin page: barbwire-security
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 5.9.2
  • First release: Oct 16, 2016
  • Latest release: Mar 12, 2021
  • Number of updates: 67
  • Update frequency: every 24.0 days
  • Top authors: munyagu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active / 2,370 total downloads

Benchmarks

Plugin footprint Passed 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.14MB] [CPU: ▼311.86ms] Passed 4 tests

Analyzing server-side resources used by Barbwire Security
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.22119.33 ▲56.77
Dashboard /wp-admin3.57 ▲0.1637.96 ▼0.57
Posts /wp-admin/edit.php3.80 ▲0.1639.98 ▲2.36
Add New Post /wp-admin/post-new.php7.04 ▲0.0794.13 ▼1,253.04
Media Library /wp-admin/upload.php3.45 ▲0.1528.28 ▲3.83
Barbwire Security /wp-admin/options-general.php?page=barb_secure_settings4.5228.99

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Barbwire Security
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,794 ▲7214.70 ▼0.627.35 ▲0.722.18 ▼0.87
Dashboard /wp-admin2,894 ▲446.15 ▼0.02119.47 ▼11.22176.80 ▲10.19
Posts /wp-admin/edit.php2,693 ▲93.36 ▲0.0164.83 ▼1.64145.58 ▼76.63
Add New Post /wp-admin/post-new.php1,714 ▲2420.80 ▼0.10476.91 ▲5.71205.70 ▲9.40
Media Library /wp-admin/upload.php1,697 ▲25.59 ▲0.05166.24 ▲9.46222.02 ▼24.94
Barbwire Security /wp-admin/options-general.php?page=barb_secure_settings1,7292.8755.42162.39

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/barbwire-security/barbwire-security.php): failed to open stream: No such file or directory in wp-content/plugins/barbwire-security/inc/Version.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/barbwire-security/inc/Version.php' (include_path='.:/usr/share/php') in wp-content/plugins/barbwire-security/admin/template/page-setting.php on line 2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/barbwire-security/inc/Version.php on line 4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/barbwire-security/admin/settings.php on line 5
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/barbwire-security/inc/Version.php): failed to open stream: No such file or directory in wp-content/plugins/barbwire-security/admin/template/page-setting.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/barbwire-security/barbwire-security.php' (include_path='.:/usr/share/php') in wp-content/plugins/barbwire-security/inc/Version.php on line 4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/barbwire-security/admin/template/page-setting.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/barbwire-security/inc/LoginParameter.php' (include_path='.:/usr/share/php') in wp-content/plugins/barbwire-security/admin/settings.php on line 5
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/barbwire-security/barbwire-security.php): failed to open stream: No such file or directory in wp-content/plugins/barbwire-security/inc/Version.php on line 4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/barbwire-security/inc/Version.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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 your attention: You can take inspiration from this readme.txt

barbwire-security/barbwire-security.php Passed 13 tests

The primary PHP file in "Barbwire Security" version 2.1.0 is used by WordPress to initiate all plugin functionality
44 characters long description:
This plugin enhances the WordPress security.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,337 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11267392977
JavaScript14525172
CSS1210127
SVG10052
INI1109

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity11.14
▷ Minimum class complexity2.00
▷ Maximum class complexity37.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods46
▷ Static methods4597.83%
▷ Public methods4189.13%
▷ Protected methods00.00%
▷ Private methods510.87%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/question_icon.png1.10KB0.24KB▼ 78.02%