67% raygun4wp

Code Review | Raygun

WordPress plugin Raygun scored 67% from 54 tests.

About plugin

  • Plugin page: raygun4wp
  • Plugin version: 2.0.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 1, 2013
  • Latest release: Feb 24, 2023
  • Number of updates: 57
  • Update frequency: every 62.0 days
  • Top authors: mindscapehq (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active / 13,345 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.21ms] Passed 4 tests

Server-side resources used by Raygun
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.14 ▼1.51
Dashboard /wp-admin3.33 ▲0.0244.37 ▼2.35
Posts /wp-admin/edit.php3.38 ▲0.0245.84 ▼2.54
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.90 ▼14.44
Media Library /wp-admin/upload.php3.25 ▲0.0238.58 ▲3.78
Settings /wp-admin/admin.php?page=rg4wp-settings3.2932.72
About /wp-admin/admin.php?page=rg4wp3.2530.00
Dashboard /wp-admin/admin.php?page=rg4wp-dash3.2432.51

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 636 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Raygun: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.25 ▼1.126.00 ▲4.3842.16 ▼1.10
Dashboard /wp-admin2,248 ▲576.02 ▲1.1398.32 ▼3.7379.23 ▲40.32
Posts /wp-admin/edit.php2,124 ▲382.06 ▲0.0733.56 ▼1.1436.58 ▲2.04
Add New Post /wp-admin/post-new.php1,548 ▲1417.58 ▼5.50742.42 ▲100.4276.93 ▲28.73
Media Library /wp-admin/upload.php1,421 ▲304.29 ▲0.0899.42 ▲2.0177.24 ▲32.45
Settings /wp-admin/admin.php?page=rg4wp-settings1,0411.8425.3128.05
About /wp-admin/admin.php?page=rg4wp8962.0123.4828.07
Dashboard /wp-admin/admin.php?page=rg4wp-dash8212.0023.2823.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/raygun4wp/vendor/mindscape/raygun4php/sample-apps/async-example/partials/head.php
    • > /wp-content/plugins/raygun4wp/dash.php
    • > /wp-content/plugins/raygun4wp/sendtesterror.php
  • 338× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Raygun4php\\RaygunClient' not found in wp-content/plugins/raygun4wp/src/RaygunClient.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Test\\TestCase' not found in wp-content/plugins/raygun4wp/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/raygun4wp/vendor/guzzlehttp/guzzle/tests/MiddlewareTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/raygun4wp/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Raygun4php\\Interfaces\\TransportInterface' not found in wp-content/plugins/raygun4wp/vendor/mindscape/raygun4php/src/Raygun4php/Transports/GuzzleSync.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/raygun4wp/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Test\\TestCase' not found in wp-content/plugins/raygun4wp/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/raygun4wp/vendor/monolog/monolog/tests/Monolog/UtilsTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/raygun4wp/vendor/guzzlehttp/psr7/src/Request.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/raygun4wp/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php:21

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can look at the official readme.txt

raygun4wp/raygun4wp.php 85% from 13 tests

Analyzing the main PHP file in "Raygun" version 2.0.1.0
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 518 characters long)
  • Git Repository: An alternative Git repository was detected

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/raygun4wp/vendor/mindscape/raygun4php/src/Raygun4php/cacert.crt
53,264 lines of code in 569 files:
LanguageFilesBlank linesComment linesLines of code
PHP4608,41515,14443,162
Markdown391,82305,359
JSON18001,772
reStructuredText88611,0901,098
YAML2522512859
XML1192462
make4485216
JavaScript11860183
CSS1162117
Python1182228
Dockerfile1608

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.12
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces45
Interfaces38
Traits8
Classes406
▷ Abstract classes81.97%
▷ Concrete classes39898.03%
▷ Final classes4310.80%
Methods3,274
▷ Static methods2226.78%
▷ Public methods2,81886.07%
▷ Protected methods2226.78%
▷ Private methods2347.15%
Functions616
▷ Named functions609.74%
▷ Anonymous functions55690.26%
Constants154
▷ Global constants21.30%
▷ Class constants15298.70%
▷ Public constants11374.34%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.63MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
img/logo.png0.25KB0.22KB▼ 12.65%
vendor/guzzlehttp/guzzle/.github/logo.png78.23KB34.21KB▼ 56.26%
img/logo-small.png5.80KB3.00KB▼ 48.22%
vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%