84% wordfence-assistant

Code Review | Wordfence Assistant

WordPress plugin Wordfence Assistant scored84%from 54 tests.

About plugin

  • Plugin page: wordfence-assistant
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.7
  • WordPress version: 6.3.1
  • First release: Jan 18, 2014
  • Latest release: Oct 26, 2022
  • Number of updates: 27
  • Update frequency: every 118.9 days
  • Top authors: wfmatt (40.74%)wfalexk (37.04%)wfryan (22.22%)mmaunder (11.11%)

Code review

54 tests

User reviews

11 reviews

Install metrics

20,000+ active /262,910 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.30ms] Passed 4 tests

A check of server-side resources used by Wordfence Assistant
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1243.83 ▲4.72
Dashboard /wp-admin3.46 ▲0.1246.08 ▼9.14
Posts /wp-admin/edit.php3.57 ▲0.1852.39 ▲4.42
Add New Post /wp-admin/post-new.php6.04 ▲0.1283.24 ▼23.92
Media Library /wp-admin/upload.php3.38 ▲0.1235.50 ▲3.44

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: no files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Wordfence Assistant
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲10313.24 ▼1.131.72 ▲0.0241.58 ▼3.90
Dashboard /wp-admin2,258 ▲735.83 ▲0.9494.08 ▼27.3090.00 ▲33.58
Posts /wp-admin/edit.php2,138 ▲492.00 ▼0.0234.60 ▼4.9432.26 ▼0.39
Add New Post /wp-admin/post-new.php1,571 ▲2922.84 ▲4.70711.67 ▲74.0951.03 ▲1.36
Media Library /wp-admin/upload.php1,437 ▲524.16 ▼0.0698.12 ▲3.1345.79 ▲2.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wordfence-assistant/lib/mainMenu.php:2
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordfence-assistant/lib/wordfenceAssistantClass.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wordfence-assistant/wordfence-assistant.php:17
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordfence-assistant/lib/wordfenceAssistantClass.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: wordfence, wordfence assistant, wordfence security helper, wordfence security assistant, wordfence helper

wordfence-assistant/wordfence-assistant.php Passed 13 tests

This is the main PHP file of "Wordfence Assistant" version 1.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
95 characters long description:
Wordfence Assistant - Helps Wordfence users with miscellaneous Wordfence data management tasks.

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
Good job! No executable or dangerous file extensions detected830 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP58773570
JavaScript100113
PO File1414995
CSS14038
SVG10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity32.33
▷ Minimum class complexity12.00
▷ Maximum class complexity62.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods48
▷ Static methods2654.17%
▷ Public methods4287.50%
▷ Protected methods00.00%
▷ Private methods612.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.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
No PNG files were detected