10% ourivesweb-api

Code Review | OurivesWeb Api

WordPress plugin OurivesWeb Apiscored10%from 54 tests.

About plugin

  • Plugin page: ourivesweb-api
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Apr 1, 2021
  • Latest release: Jun 15, 2022
  • Number of updates: 8
  • Update frequency: every 55.0 days
  • Top authors: ponto25 (62.5%)wesleydeveloper (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,070 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/ourivesweb-api/src/Activators/Install.php+18
    Uncaught Error: Call to undefined function OurivesWeb\Activators\esc_htmlecho() in wp-content/plugins/ourivesweb-api/src/Activators/Install.php:18
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): OurivesWeb\Activators\Install::run()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

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

A check of server-side resources used by OurivesWeb Api
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.06 ▼7.15
Dashboard /wp-admin3.31 ▲0.0052.19 ▼2.07
Posts /wp-admin/edit.php3.36 ▲0.0048.82 ▼3.84
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.33 ▼12.62
Media Library /wp-admin/upload.php3.23 ▲0.0040.82 ▲3.10

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,507 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for OurivesWeb Api
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.48 ▲0.522.00 ▲0.3347.74 ▲9.10
Dashboard /wp-admin2,221 ▲215.86 ▲0.97114.59 ▲5.9141.59 ▼2.75
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0034.60 ▼16.0134.86 ▼13.06
Add New Post /wp-admin/post-new.php1,545 ▼123.29 ▲0.20672.06 ▲85.3154.06 ▲7.11
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.07107.30 ▲10.3745.92 ▲3.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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 fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/ourivesweb-api/src/Views/Messages/DocumentError.php
  • 525× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Wsdl\\Provider\\WsdlProviderInterface' not found in wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/src/Phpro/SoapClient/Wsdl/Provider/LocalWsdlProvider.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Soap\\Engine\\Metadata\\MetadataProviderInterface' not found in wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/src/Phpro/SoapClient/Soap/Engine/EngineInterface.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Type\\ResultInterface' not found in wp-content/plugins/ourivesweb-api/src/Type/GetArtigoStockRefResponse.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\CodeGenerator\\Assembler\\AssemblerInterface' not found in wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/src/Phpro/SoapClient/CodeGenerator/Assembler/InterfaceAssembler.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PhpSpec\\ObjectBehavior' not found in wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/spec/Phpro/SoapClient/CodeGenerator/Rules/TypeMapRuleSpec.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Type\\ResultInterface' not found in wp-content/plugins/ourivesweb-api/src/Type/GetClientesResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\CodeGenerator\\Rules\\RuleInterface' not found in wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/src/Phpro/SoapClient/CodeGenerator/Rules/AssembleRule.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Soap\\Engine\\EncoderInterface' not found in wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/src/Phpro/SoapClient/Soap/Driver/ExtSoap/ExtSoapEncoder.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Type\\ResultInterface' not found in wp-content/plugins/ourivesweb-api/src/Type/UpLoadImageResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpro\\SoapClient\\Type\\RequestInterface' not found in wp-content/plugins/ourivesweb-api/src/Type/DownloadImages.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === OurivesWeb Api=== )
The official readme.txt is a good inspiration

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

The main PHP script in "OurivesWeb Api" version 1.1.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ourivesweb-api.php" instead of "ourivesweb.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "5.2")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/ourivesweb-api/vendor/symfony/console/Resources/bin/hiddeninput.exe
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/ourivesweb-api/vendor/phpro/soap-client/test/fixtures/certificates/wsse-server-x509.crt
103,794 lines of code in 1,453 files:
LanguageFilesBlank linesComment linesLines of code
PHP73711,63618,33556,273
SVG5200035,423
XML8329233,533
Markdown5695302,523
JSON24002,325
CSS83682,118
HTML2140588
LESS6180444
Sass431296
YAML650137
Bourne Again Shell1101457
CoffeeScript18036
Bourne Shell110025
JavaScript411216

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for 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.28
Average class complexity6.13
▷ Minimum class complexity1.00
▷ Maximum class complexity192.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces155
Interfaces66
Traits6
Classes630
▷ Abstract classes172.70%
▷ Concrete classes61397.30%
▷ Final classes477.67%
Methods3,997
▷ Static methods3137.83%
▷ Public methods3,55889.02%
▷ Protected methods1724.30%
▷ Private methods2676.68%
Functions279
▷ Named functions13849.46%
▷ Anonymous functions14150.54%
Constants181
▷ Global constants3016.57%
▷ Class constants15183.43%
▷ Public constants11274.17%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 1.92MB with 0.82MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/ourives_gm.png1,964.66KB1,743.97KB▼ 11.23%
assets/img/Mini_logo.png2.59KB0.50KB▼ 80.90%
assets/img/logo_ponto25_100.png3.27KB2.10KB▼ 35.93%