84% spatie-ray

Code Review | Ray

WordPress plugin Ray scored84%from 54 tests.

About plugin

  • Plugin page: spatie-ray
  • Plugin version: 1.7.5
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Jan 13, 2021
  • Latest release: Mar 21, 2023
  • Number of updates: 37
  • Update frequency: every 21.5 days
  • Top authors: freekmurze (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active /19,344 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.00MB] [CPU: ▼10.88ms] Passed 4 tests

Server-side resources used by Ray
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.0042.80 ▼9.56
Dashboard /wp-admin3.57 ▲0.0048.17 ▼18.59
Posts /wp-admin/edit.php3.68 ▲0.0050.80 ▼7.31
Add New Post /wp-admin/post-new.php6.15 ▲0.0087.39 ▼8.06
Media Library /wp-admin/upload.php3.49 ▲0.0040.16 ▲0.73

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 454 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Ray
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.37 ▼0.011.64 ▼0.8844.15 ▼3.34
Dashboard /wp-admin2,195 ▲215.60 ▼0.1193.62 ▼1.5438.88 ▼6.37
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0138.76 ▼0.4636.92 ▼1.37
Add New Post /wp-admin/post-new.php1,545 ▼023.45 ▲0.19598.94 ▼81.3158.53 ▼2.23
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.0197.05 ▼3.0049.47 ▲2.44

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 196× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Collection\\ArrayInterface' not found in wp-content/plugins/spatie-ray/vendor/ramsey/collection/src/AbstractArray.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Collection\\Map\\MapInterface' not found in wp-content/plugins/spatie-ray/vendor/ramsey/collection/src/Map/TypedMapInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractCollection' not found in wp-content/plugins/spatie-ray/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Exception\\UuidExceptionInterface' not found in wp-content/plugins/spatie-ray/vendor/ramsey/uuid/src/Exception/DateTimeException.php:22
    • > PHP Parse error
      syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in wp-content/plugins/spatie-ray/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php on line 29
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractCollection' not found in wp-content/plugins/spatie-ray/vendor/ramsey/collection/src/AbstractSet.php:25
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/spatie-ray/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php on line 128
    • > PHP Parse error
      syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in wp-content/plugins/spatie-ray/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php on line 53
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' not found in wp-content/plugins/spatie-ray/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Spatie\\Ray\\Payloads\\Payload' not found in wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Payloads/NewScreenPayload.php:5

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 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Here's how the Ray desktop app looks like.) image missing
The official readme.txt is a good inspiration

spatie-ray/wp-ray.php 92% from 13 tests

Analyzing the main PHP file in "Ray" version 1.7.5
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("spatie-ray.php" instead of "wp-ray.php")

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
Success! There were no dangerous files found in this plugin30,292 lines of code in 432 files:
LanguageFilesBlank linesComment linesLines of code
PHP3825,98012,50826,485
JSON18001,984
Markdown2892301,666
CSS100130
XML24117
JavaScript10010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity8.27
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces64
Interfaces42
Traits18
Classes297
▷ Abstract classes113.70%
▷ Concrete classes28696.30%
▷ Final classes4214.69%
Methods1,738
▷ Static methods30617.61%
▷ Public methods1,51186.94%
▷ Protected methods925.29%
▷ Private methods1357.77%
Functions169
▷ Named functions9958.58%
▷ Anonymous functions7041.42%
Constants165
▷ Global constants95.45%
▷ Class constants15694.55%
▷ Public constants12076.92%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin