83% mobiloud-commerce

Code Review | MobiLoud Commerce

WordPress plugin MobiLoud Commerce scored83%from 54 tests.

About plugin

  • Plugin page: mobiloud-commerce
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8
  • WordPress version: 6.3.1
  • First release: Jul 9, 2021
  • Latest release: Aug 12, 2021
  • Number of updates: 6
  • Update frequency: every 15.0 days
  • Top authors: psac50 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /724 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.71ms] Passed 4 tests

A check of server-side resources used by MobiLoud Commerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.89 ▼5.60
Dashboard /wp-admin3.38 ▲0.0854.64 ▲3.81
Posts /wp-admin/edit.php3.49 ▲0.1456.67 ▲4.56
Add New Post /wp-admin/post-new.php5.96 ▲0.0890.29 ▼16.16
Media Library /wp-admin/upload.php3.30 ▲0.0741.59 ▲3.11

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 112 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
mobiloud_popup_on_activation
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by MobiLoud Commerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲12313.55 ▼0.632.05 ▲0.1842.42 ▼1.83
Dashboard /wp-admin2,220 ▲294.88 ▼1.02105.60 ▲0.9338.79 ▼4.23
Posts /wp-admin/edit.php2,103 ▲142.04 ▲0.0241.59 ▲1.4739.39 ▲5.56
Add New Post /wp-admin/post-new.php1,523 ▼517.81 ▼5.44676.16 ▲27.0354.51 ▲1.34
Media Library /wp-admin/upload.php1,405 ▲204.27 ▲0.08100.06 ▼2.0941.74 ▼5.75

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • mobiloud_popup_on_activation
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/templates/orders.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MLWoo\\Ecommerce\\WooCommerce\\Endpoints\\Base' not found in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/endpoints/class-product-categories.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MLWoo\\Ecommerce\\WooCommerce\\Endpoints\\Base' not found in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/endpoints/class-product-category.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/templates/product-categories.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MLWoo\\Ecommerce\\WooCommerce\\Endpoints\\Base' not found in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/endpoints/class-account-orders.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'MLWoo\\Ecommerce\\WooCommerce\\Endpoints\\Base' not found in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/endpoints/class-single-product.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/templates/order-received.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mobiloud-commerce/mobiloud-ecommerce.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/templates/single-product.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MLWoo\\Ecommerce\\WooCommerce\\Endpoints\\Base' not found in wp-content/plugins/mobiloud-commerce/mlwoo/ecommerce/woocommerce/endpoints/class-account-view-order.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (**Settings** - The plugin allows you to enable the commerce integration from the MobiLoud Plugin)
The official readme.txt is a good inspiration

mobiloud-commerce/mobiloud-ecommerce.php 77% from 13 tests

The main file in "MobiLoud Commerce" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("mobiloud-commerce.php" instead of "mobiloud-ecommerce.php")

Code Analysis Passed 3 tests

File types Passed 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
No dangerous file extensions were detected5,229 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP495597762,742
Sass1321801,187
JavaScript21194581,148
CSS126067
JSON30050
SVG30035

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.24
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods101
▷ Static methods1514.85%
▷ Public methods10099.01%
▷ Protected methods00.00%
▷ Private methods10.99%
Functions19
▷ Named functions1578.95%
▷ Anonymous functions421.05%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.20MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/woocommerce-placeholder.png100.24KB73.05KB▼ 27.12%
src/images/woocommerce-placeholder.png100.24KB73.05KB▼ 27.12%