84% ferret

Code Review | Ferret

WordPress plugin Ferret scored84%from 54 tests.

About plugin

  • Plugin page: ferret
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 11, 2019
  • Latest release: Mar 16, 2020
  • Number of updates: 20
  • Update frequency: every 21.5 days
  • Top authors: leapspark (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /882 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 gracefully, with no errors

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

An overview of server-side resources used by Ferret
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4537.00 ▼2.84
Dashboard /wp-admin3.76 ▲0.4148.17 ▼11.11
Posts /wp-admin/edit.php3.81 ▲0.4549.24 ▲4.14
Add New Post /wp-admin/post-new.php6.28 ▲0.3994.55 ▼2.05
Media Library /wp-admin/upload.php3.62 ▲0.3937.77 ▲0.54
Ferret Settings /wp-admin/options-general.php?page=ferret3.5934.52

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 531 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Ferret
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8313.23 ▼1.151.48 ▼0.2942.00 ▲1.25
Dashboard /wp-admin2,224 ▲335.85 ▲0.96108.37 ▲3.9742.02 ▼3.38
Posts /wp-admin/edit.php2,107 ▲182.03 ▲0.0340.52 ▲5.2535.60 ▲2.30
Add New Post /wp-admin/post-new.php1,545 ▲1223.18 ▼0.06661.64 ▼6.0447.86 ▼10.58
Media Library /wp-admin/upload.php1,406 ▲184.17 ▼0.06106.92 ▲5.2944.19 ▲1.12
Ferret Settings /wp-admin/options-general.php?page=ferret8652.1527.7330.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 259× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/ferret/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/ferret/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Message\\Builder\\ResponseBuilder' not found in wp-content/plugins/ferret/vendor/php-http/curl-client/src/ResponseBuilder.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\umberConverterInterface' not found in wp-content/plugins/ferret/vendor/ramsey/uuid/src/Converter/Number/DegradedNumberConverter.php:25
    • > PHP Fatal error
      Trait 'Http\\Message\\Decorator\\MessageDecorator' not found in wp-content/plugins/ferret/vendor/php-http/message/src/Decorator/RequestDecorator.php on line 11
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Discovery\\Exception' not found in wp-content/plugins/ferret/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/ferret/admin/admin-view.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientInterface' not found in wp-content/plugins/ferret/vendor/php-http/httplug/src/HttpClient.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Sentry\\FlushableClientInterface' not found in wp-content/plugins/ferret/vendor/sentry/sentry/src/Client.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Sentry\\Transport\\TransportInterface' not found in wp-content/plugins/ferret/vendor/sentry/sentry/src/Transport/SpoolTransport.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === ferret === )
You can take inspiration from this readme.txt

ferret/plugin.php 92% from 13 tests

This is the main PHP file of "Ferret" version 2.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ferret.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected27,900 lines of code in 494 files:
LanguageFilesBlank linesComment linesLines of code
PHP4155,48115,03620,156
Markdown402,70004,742
JSON28002,744
XML5191130
PO File1161687
YAML35229
make1409
Bourne Shell1203

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity6.26
▷ Minimum class complexity1.00
▷ Maximum class complexity123.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces65
Interfaces67
Traits15
Classes294
▷ Abstract classes62.04%
▷ Concrete classes28897.96%
▷ Final classes13847.92%
Methods1,858
▷ Static methods20811.19%
▷ Public methods1,59685.90%
▷ Protected methods693.71%
▷ Private methods19310.39%
Functions208
▷ Named functions8239.42%
▷ Anonymous functions12660.58%
Constants102
▷ Global constants32.94%
▷ Class constants9997.06%
▷ Public constants9494.95%

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
There are no PNG files in this plugin