10% mail-boxes-etc

Code Review | MBE eShip

WordPress plugin MBE eShip scored10%from 54 tests.

About plugin

  • Plugin page: mail-boxes-etc
  • Plugin version: 2.0.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Oct 10, 2017
  • Latest release: Apr 26, 2023
  • Number of updates: 73
  • Update frequency: every 27.9 days
  • Top authors: mbeelink (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /12,037 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/mail-boxes-etc/lib/Mbe/MbeSoapClient.php+3
    Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/mail-boxes-etc/lib/Mbe/MbeSoapClient.php:3
    Stack trace:
    #0 wp-content/plugins/mail-boxes-etc/mail-boxes-etc.php(90): require_once()
    #1 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #2 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

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

A check of server-side resources used by MBE eShip
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.0044.05 ▼4.38
Dashboard /wp-admin3.57 ▼0.0756.10 ▼14.28
Posts /wp-admin/edit.php3.68 ▲0.0051.51 ▲4.11
Add New Post /wp-admin/post-new.php6.15 ▲0.0087.04 ▼17.57
Media Library /wp-admin/upload.php3.49 ▲0.0041.17 ▲5.18

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

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Total filesystem usage must be limited to 25MB (currently using 40.77MB)
Filesystem: 906 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by MBE eShip
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.70 ▲0.422.02 ▼0.0844.66 ▲2.34
Dashboard /wp-admin2,195 ▲245.63 ▲0.0795.26 ▼4.5344.25 ▼0.47
Posts /wp-admin/edit.php2,079 ▼212.01 ▼0.0235.90 ▼1.5234.12 ▼2.11
Add New Post /wp-admin/post-new.php1,531 ▼1423.50 ▲0.18679.65 ▲67.1153.53 ▲0.00
Media Library /wp-admin/upload.php1,400 ▲34.25 ▲0.0198.84 ▼6.0846.03 ▼0.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 83× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/index.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_019.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_041.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_033.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_010.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_023.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svgi.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_028.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_032.php
    • > /wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_026.php
  • 201× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/mail-boxes-etc/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/loca.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Mbe_Shipping_Helper_Data' not found in wp-content/plugins/mail-boxes-etc/includes/cron.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_locale() in wp-content/plugins/mail-boxes-etc/includes/settings-welcome.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\AbstractRenderer' not found in wp-content/plugins/mail-boxes-etc/lib/dompdf/src/Renderer/ListBullet.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/mail-boxes-etc/lib/dompdf/lib/php-font-lib/src/FontLib/Table/Type/name.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/mail-boxes-etc/lib/vendor/setasign/fpdi/src/FpdfTpl.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/mail-boxes-etc/lib/dompdf/src/FrameReflower/Text.php:20
    • > PHP Warning
      require_once(wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/example_066.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/mail-boxes-etc/lib/vendor/setasign/fpdi/src/PdfParser/Filter/LzwException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/mail-boxes-etc/lib/dompdf/src/Positioner/Inline.php:19

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 Passed 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
4 plugin tags: woocommerce, mailbox, mbe, eship

mail-boxes-etc/mail-boxes-etc.php Passed 13 tests

The primary PHP file in "MBE eShip" version 2.0.4 is used by WordPress to initiate all plugin functionality
75 characters long description:
Mail Boxes Etc. Online MBE Plugin integration for main Ecommerce platforms.

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/mail-boxes-etc/lib/vendor/tecnickcom/tcpdf/examples/data/cert/tcpdf.crt
109,943 lines of code in 611 files:
LanguageFilesBlank linesComment linesLines of code
PHP52515,04536,385101,851
PO File51,6321,0173,452
SVG4111,890
Markdown1234601,206
CSS4313851699
JSON1100548
XML632194
YAML419286
HTML10017

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,412)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity49.08
▷ Minimum class complexity1.00
▷ Maximum class complexity4,412.00
Average method complexity5.23
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces47
Interfaces11
Traits2
Classes298
▷ Abstract classes144.70%
▷ Concrete classes28495.30%
▷ Final classes82.82%
Methods3,606
▷ Static methods2717.52%
▷ Public methods2,80277.70%
▷ Protected methods71019.69%
▷ Private methods942.61%
Functions53
▷ Named functions1528.30%
▷ Anonymous functions3871.70%
Constants527
▷ Global constants16731.69%
▷ Class constants36068.31%
▷ Public constants35598.61%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.56MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/vendor/tecnickcom/tcpdf/examples/images/image_with_alpha.png238.49KB61.71KB▼ 74.12%
lib/vendor/tecnickcom/tcpdf/examples/images/img.png190.57KB64.69KB▼ 66.06%
lib/vendor/tecnickcom/tcpdf/examples/images/_blank.png0.13KB0.09KB▼ 30.66%
lib/vendor/tecnickcom/tcpdf/examples/images/logo_example.png18.96KB17.68KB▼ 6.71%
lib/vendor/tecnickcom/tcpdf/examples/images/tcpdf_signature.png66.34KB25.47KB▼ 61.61%