72% megamo

Code Review | MgoSync - European dropshipping and suppliers

WordPress plugin MgoSync - European dropshipping and suppliers scored72%from 54 tests.

About plugin

  • Plugin page: megamo
  • Plugin version: 2.1.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Mar 29, 2023
  • Latest release: Aug 23, 2023
  • Number of updates: 9
  • Update frequency: every 16.9 days
  • Top authors: megamo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /633 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.53MB] [CPU: ▼23.96ms] Passed 4 tests

Server-side resources used by MgoSync - European dropshipping and suppliers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1437.04 ▼11.10
Dashboard /wp-admin3.46 ▲0.1247.69 ▼16.31
Posts /wp-admin/edit.php3.57 ▲0.2250.10 ▲0.64
Add New Post /wp-admin/post-new.php3.34 ▼2.5536.36 ▼65.94
Media Library /wp-admin/upload.php3.38 ▲0.1535.73 ▼2.48
About us /wp-admin/admin.php?page=mgo_guideline3.4032.72
Settings /wp-admin/admin.php?page=mgo_settings3.3938.89
Contact us /wp-admin/admin.php?page=mgo_contact_us3.4032.67
Dashboard /wp-admin/admin.php?page=mgo_dashboard3.4330.74

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 60 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
mgosync_api_access_token
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for MgoSync - European dropshipping and suppliers
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲13513.54 ▼1.111.77 ▼0.1739.51 ▼6.32
Dashboard /wp-admin2,262 ▲745.86 ▼0.02100.18 ▼17.3440.32 ▼5.85
Posts /wp-admin/edit.php2,152 ▲842.03 ▲0.0139.94 ▲3.2735.43 ▲0.02
Add New Post /wp-admin/post-new.php1,555 ▲2018.39 ▼4.87637.32 ▼41.6156.46 ▼4.08
Media Library /wp-admin/upload.php1,442 ▲544.21 ▼0.0695.69 ▼21.5841.69 ▼8.61
About us /wp-admin/admin.php?page=mgo_guideline1,5849.13305.3584.98
Settings /wp-admin/admin.php?page=mgo_settings1,0072.1828.3043.05
Contact us /wp-admin/admin.php?page=mgo_contact_us1,1502.0726.4940.61
Dashboard /wp-admin/admin.php?page=mgo_dashboard1,3642.0623.2446.20

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • mgosync_api_access_token
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mgo_dashboard
    • > Notice in wp-content/plugins/megamo/includes/services/class-mgosync-service.php+73
    Undefined index: ck
    • > GET request to /wp-admin/admin.php?page=mgo_settings
    • > Notice in wp-content/plugins/megamo/includes/controllers/class-settings-controller.php+58
    Undefined index: userName
    • > GET request to /wp-admin/admin.php?page=mgo_settings
    • > Notice in wp-content/plugins/megamo/includes/controllers/class-settings-controller.php+58
    Undefined index: datetime

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
Please fix the following items
  • 30× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/megamo/includes/controllers/class-dashboard-controller.php
    • > /wp-content/plugins/megamo/includes/views/components/contact-form.php
    • > /wp-content/plugins/megamo/includes/views/components/settings-missing-cta.php
    • > /wp-content/plugins/megamo/includes/class-megamo-api-rest-client.php
    • > /wp-content/plugins/megamo/includes/views/about-us-view.php
    • > /wp-content/plugins/megamo/megamo.php
    • > /wp-content/plugins/megamo/includes/views/settings-view.php
    • > /wp-content/plugins/megamo/includes/views/browse-suppliers-view.php
    • > /wp-content/plugins/megamo/includes/views/components/suppliers.php
    • > /wp-content/plugins/megamo/includes/controllers/class-about-us-controller.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'MGO_PLUGIN_DIR/includes/validators/class-wp-validator.php' (include_path='.:/usr/share/php') in wp-content/plugins/megamo/includes/views/components/requirements.php on line 5
    • > PHP Warning
      require_once(MGO_PLUGIN_DIR/includes/validators/class-wp-validator.php): failed to open stream: No such file or directory in wp-content/plugins/megamo/includes/views/components/requirements.php on line 5
    • > PHP Warning
      Use of undefined constant MGO_PLUGIN_DIR - assumed 'MGO_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/megamo/includes/views/components/requirements.php on line 5
    • > PHP Warning
      Use of undefined constant MGO_PLUGIN_DIR - assumed 'MGO_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/megamo/includes/services/class-megamo-service.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'MGO_PLUGIN_DIR/includes/services/class-mgosync-service.php' (include_path='.:/usr/share/php') in wp-content/plugins/megamo/includes/services/class-megamo-service.php on line 5
    • > PHP Warning
      require_once(MGO_PLUGIN_DIR/includes/services/class-mgosync-service.php): failed to open stream: No such file or directory in wp-content/plugins/megamo/includes/services/class-megamo-service.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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: These screenshots lack descriptions #2, #3 in megamo/assets to your readme.txt
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
The official readme.txt is a good inspiration

megamo/megamo.php 92% from 13 tests

The primary PHP file in "MgoSync - European dropshipping and suppliers" version 2.1.5 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 167 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin8,311 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JSON2005,233
PHP34578662,099
CSS130235936
SVG70028
JavaScript13115

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity9.24
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes16
▷ Abstract classes16.25%
▷ Concrete classes1593.75%
▷ Final classes00.00%
Methods94
▷ Static methods33.19%
▷ Public methods8287.23%
▷ Protected methods00.00%
▷ Private methods1212.77%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.38MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/png/banner2560.png28.37KB12.04KB▼ 57.57%
assets/images/png/warehouse1280.png43.99KB17.53KB▼ 60.14%
assets/images/png/banner1280.png14.31KB6.61KB▼ 53.82%
assets/images/png/warehouse640.png21.82KB8.70KB▼ 60.11%
assets/images/png/warehouse1920.png67.55KB26.71KB▼ 60.46%