10% marvinerp-api

Code Review | Marvinerp

WordPress plugin Marvinerpscored10%from 54 tests.

About plugin

  • Plugin page: marvinerp-api
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.6
  • WordPress version: 6.3.1
  • First release: Nov 3, 2020
  • Latest release: Mar 30, 2021
  • Number of updates: 31
  • Update frequency: every 4.9 days
  • Top authors: ponto25 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,369 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-includes/plugin.php+1001
    Undefined offset: 0

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

Server-side resources used by Marvinerp
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.99 ▼3.25
Dashboard /wp-admin3.31 ▲0.0050.60 ▼2.37
Posts /wp-admin/edit.php3.36 ▲0.0050.12 ▼0.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.28 ▼17.26
Media Library /wp-admin/upload.php3.23 ▲0.0038.64 ▲3.72

Server storage [IO: ▲43.28MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 43.28MB)
Filesystem: 1,092 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Marvinerp: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.161.84 ▼0.0243.94 ▼2.37
Dashboard /wp-admin2,195 ▲155.62 ▼0.0187.39 ▼3.5938.64 ▼1.75
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0234.75 ▼7.4534.51 ▼5.03
Add New Post /wp-admin/post-new.php1,550 ▼423.37 ▲5.00674.03 ▲41.3552.76 ▲3.53
Media Library /wp-admin/upload.php1,400 ▼04.25 ▲0.0698.89 ▼11.9741.64 ▼3.64

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/marvinerp-api/src/Views/Messages/DocumentError.php
  • 590× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Soap\\Engine\\EngineInterface' not found in wp-content/plugins/marvinerp-api/vendor/phpro/soap-client/src/Phpro/SoapClient/Soap/Engine/Engine.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Type\\ResultInterface' not found in wp-content/plugins/marvinerp-api/src/Type/GetPndForResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Laminas\\Code\\Reflection\\DocBlock\\Tag\\TagInterface' not found in wp-content/plugins/marvinerp-api/vendor/laminas/laminas-code/src/Reflection/DocBlock/Tag/GenericTag.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Laminas\\Code\\Generator\\DocBlock\\Tag\\GenericTag' not found in wp-content/plugins/marvinerp-api/vendor/laminas/laminas-code/src/Generator/DocBlock/Tag.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' not found in wp-content/plugins/marvinerp-api/vendor/symfony/console/Formatter/OutputFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\String\\AbstractUnicodeString' not found in wp-content/plugins/marvinerp-api/vendor/symfony/string/UnicodeString.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Soap\\TypeConverter\\TypeConverterInterface' not found in wp-content/plugins/marvinerp-api/vendor/phpro/soap-client/src/Phpro/SoapClient/Soap/TypeConverter/DateTimeTypeConverter.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PhpSpec\\ObjectBehavior' not found in wp-content/plugins/marvinerp-api/vendor/phpro/soap-client/spec/Phpro/SoapClient/CodeGenerator/Util/NormalizerSpec.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/marvinerp-api/vendor/phpro/soap-client/test/PhproTest/SoapClient/Integration/Soap/Driver/ExtSoap/ExtSoapOptionsTest.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Console\\Input\\InputInterface' not found in wp-content/plugins/marvinerp-api/vendor/symfony/console/Input/Input.php:28

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Marvinerp=== )
The official readme.txt is a good inspiration

marvinerp-api/marvinerp.php 85% from 13 tests

The principal PHP file in "Marvinerp" v. 1.1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.6" instead of "5.2")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("marvinerp-api.php" instead of "marvinerp.php")

Code Analysis 5% from 3 tests

File types 0% from 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
Please make sure to remedy the following
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/marvinerp-api/vendor/symfony/console/Resources/bin/hiddeninput.exe
    • .bat - Batch File in Windows
      • wp-content/plugins/marvinerp-api/vendor/bin/phpstan.bat
      • wp-content/plugins/marvinerp-api/vendor/bin/phpstan.phar.bat
      • wp-content/plugins/marvinerp-api/vendor/bin/soap-client.bat
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/marvinerp-api/vendor/phpro/soap-client/test/fixtures/certificates/wsse-server-x509.crt
97,726 lines of code in 1,022 files:
LanguageFilesBlank linesComment linesLines of code
PHP81213,348112,12587,263
XML8329233,533
Markdown651,49303,306
JSON27102,719
CSS5256385
Bourne Shell115466214
YAML9236187
HTML19085
SVG30018
DOS Batch30012
JavaScript30124

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.87
▷ Minimum class complexity1.00
▷ Maximum class complexity199.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces167
Interfaces90
Traits9
Classes1,087
▷ Abstract classes312.85%
▷ Concrete classes1,05697.15%
▷ Final classes625.87%
Methods8,933
▷ Static methods7388.26%
▷ Public methods7,86888.08%
▷ Protected methods7057.89%
▷ Private methods3604.03%
Functions3,428
▷ Named functions3,26195.13%
▷ Anonymous functions1674.87%
Constants391
▷ Global constants6516.62%
▷ Class constants32683.38%
▷ Public constants31195.40%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/Mini_logo.png0.96KB0.91KB▼ 5.48%
img/logo_marvin_180b.png2.60KB2.53KB▼ 2.59%
img/logo_ponto25_100.png3.27KB2.10KB▼ 35.93%
img/logo.png4.59KB3.63KB▼ 20.96%