78% nostrtium

Code Review | Nostrtium

WordPress plugin Nostrtium scored 78% from 54 tests.

About plugin

  • Plugin page: nostrtium
  • Plugin version: 0.7.4
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2023
  • Latest release: Jun 23, 2023
  • Number of updates: 10
  • Update frequency: every 5.6 days
  • Top authors: pjv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 510 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.48ms] Passed 4 tests

A check of server-side resources used by Nostrtium
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0046.70 ▼4.58
Dashboard /wp-admin3.31 ▲0.0065.00 ▲6.60
Posts /wp-admin/edit.php3.36 ▲0.0067.16 ▲10.39
Add New Post /wp-admin/post-new.php5.89 ▲0.00125.12 ▼15.36
Media Library /wp-admin/upload.php3.23 ▲0.0043.75 ▲7.41

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 535 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Nostrtium: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1513.29 ▲0.082.16 ▲0.4051.84 ▲2.74
Dashboard /wp-admin2,206 ▲144.83 ▼0.03124.43 ▲18.1853.84 ▲9.42
Posts /wp-admin/edit.php2,089 ▲142.02 ▲0.0348.33 ▲8.9543.42 ▲5.42
Add New Post /wp-admin/post-new.php1,536 ▲1021.06 ▼2.12731.64 ▲76.1566.60 ▲15.16
Media Library /wp-admin/upload.php1,385 ▲114.13 ▲0.02117.21 ▲5.8253.76 ▲11.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/nostrtium/vendor/paragonie/halite/doc/Examples/01-passwords.php
  • 344× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/nostrtium/vendor/paragonie/halite/src/KeyFactory.php on line 827
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\ASNObject' not found in wp-content/plugins/nostrtium/vendor/fgrosse/phpasn1/lib/ASN1/AbstractString.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\AbstractString' not found in wp-content/plugins/nostrtium/vendor/fgrosse/phpasn1/lib/ASN1/Universal/PrintableString.php:16
    • > PHP Notice
      Constant SODIUM_CRYPTO_STREAM_NONCEBYTES already defined in wp-content/plugins/nostrtium/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 90
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_HChaCha20' not found in wp-content/plugins/nostrtium/vendor/paragonie/sodium_compat/src/Core/XChaCha20.php:10
    • > PHP Warning
      require_once(wp-content/plugins/nostrtium/vendor/paragonie/halite/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/nostrtium/vendor/paragonie/halite/test/random_audit.php on line 5
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/nostrtium/vendor/textalk/websocket/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/nostrtium/vendor/textalk/websocket/examples/random_server.php on line 16
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/nostrtium/vendor/psr/log/src/AbstractLogger.php:12
    • > PHP Notice
      Constant SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 already defined in wp-content/plugins/nostrtium/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 55
    • > PHP Fatal error
      Uncaught Error: Interface 'swentel\ostr\\RelayInterface' not found in wp-content/plugins/nostrtium/vendor/swentel/nostr-php/src/Relay/Relay.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: social media, nostr

nostrtium/nostrtium.php 92% from 13 tests

This is the main PHP file of "Nostrtium" version 0.7.4, 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:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin51,884 lines of code in 494 files:
LanguageFilesBlank linesComment linesLines of code
PHP4057,13822,95647,844
Markdown6291602,171
JSON3001,198
JavaScript41616222
YAML4123114
make55222108
CSS481077
XML41076
Bourne Shell37674

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.22
Average class complexity10.31
▷ Minimum class complexity1.00
▷ Maximum class complexity386.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces71
Interfaces36
Traits3
Classes330
▷ Abstract classes4112.42%
▷ Concrete classes28987.58%
▷ Final classes3311.42%
Methods2,456
▷ Static methods83734.08%
▷ Public methods2,21990.35%
▷ Protected methods1486.03%
▷ Private methods893.62%
Functions334
▷ Named functions30992.51%
▷ Anonymous functions257.49%
Constants626
▷ Global constants172.72%
▷ Class constants60997.28%
▷ Public constants60799.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.14MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/paragonie/halite/test/unit/tmp/paragon_avatar.png138.54KB84.45KB▼ 39.05%