10% troll-hunter

Code Review | Troll Hunter by Gavagai

WordPress plugin Troll Hunter by Gavagai scored10%from 54 tests.

About plugin

  • Plugin page: troll-hunter
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 8, 2014
  • Latest release: Dec 16, 2014
  • Number of updates: 7
  • Update frequency: every 1.4 days
  • Top authors: mikaelnehlsen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /591 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/troll-hunter/TrollHunter_Plugin.php+27
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.10MB] [CPU: ▼8.38ms] Passed 4 tests

An overview of server-side resources used by Troll Hunter by Gavagai
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1237.37 ▼1.56
Dashboard /wp-admin3.42 ▲0.0746.84 ▼11.56
Posts /wp-admin/edit.php3.53 ▲0.1747.40 ▲1.10
Add New Post /wp-admin/post-new.php6.00 ▲0.1180.43 ▼17.62
Media Library /wp-admin/upload.php3.34 ▲0.1132.63 ▼2.76
Troll Hunter /wp-admin/plugins.php?page=TrollHunter_PluginSettings3.3131.24

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
widget_recent-comments
TrollHunter_Plugin_apiKey
widget_recent-posts
theysaidso_admin_options
TrollHunter_Plugin__version
db_upgraded
TrollHunter_Plugin__installed
widget_theysaidso_widget
TrollHunter_Plugin_language

Browser metrics Passed 4 tests

A check of browser resources used by Troll Hunter by Gavagai
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.14 ▼0.451.52 ▼0.1040.21 ▲0.86
Dashboard /wp-admin2,199 ▲185.57 ▼0.0994.67 ▼5.8739.80 ▼4.03
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0238.85 ▲1.3634.68 ▼0.24
Add New Post /wp-admin/post-new.php1,529 ▼821.16 ▲2.87671.03 ▲69.4361.09 ▼5.99
Media Library /wp-admin/upload.php1,401 ▲44.22 ▼0.0096.43 ▼9.8641.17 ▼5.43
Troll Hunter /wp-admin/plugins.php?page=TrollHunter_PluginSettings8921.9924.8424.65

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-posts
    • TrollHunter_Plugin_language
    • can_compress_scripts
    • db_upgraded
    • TrollHunter_Plugin__installed
    • TrollHunter_Plugin_apiKey
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • TrollHunter_Plugin__version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/troll-hunter/trunk/troll-hunter.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/troll-hunter/troll-hunter.php:66

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/plugins.php?page=TrollHunter_PluginSettings
    • > Network (severe)
    https://gavagai.se/app/themes/gavagai/img/gavagai-logo.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

troll-hunter/troll-hunter.php 92% from 13 tests

"Troll Hunter by Gavagai" version 0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 306 characters long)

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 detected733 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP8192514572
PO File25252161

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.17
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes433.33%
▷ Concrete classes866.67%
▷ Final classes00.00%
Methods152
▷ Static methods00.00%
▷ Public methods9663.16%
▷ Protected methods5636.84%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin