77% dma-woo-modal-cart-lite

Code Review | DMA WOO Modal Cart Lite

WordPress plugin DMA WOO Modal Cart Lite scored77%from 54 tests.

About plugin

  • Plugin page: dma-woo-modal-car...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.8
  • WordPress version: 6.3.1
  • First release: Jun 3, 2020
  • Latest release: Oct 7, 2021
  • Number of updates: 17
  • Update frequency: every 28.9 days
  • Top authors: dmaexpertit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /495 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼18.68ms] Passed 4 tests

Server-side resources used by DMA WOO Modal Cart Lite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.97 ▼0.4912.93 ▼25.06
Dashboard /wp-admin3.85 ▲0.5529.27 ▼17.46
Posts /wp-admin/edit.php3.92 ▲0.5630.31 ▼14.70
Add New Post /wp-admin/post-new.php6.09 ▲0.2170.41 ▼17.50
Media Library /wp-admin/upload.php3.85 ▲0.6230.82 ▼5.59
DMA WOO Modal Cart Lite /wp-admin/admin.php?page=dma-woo-modal-cart-lite3.8328.88

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 39 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for DMA WOO Modal Cart Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲17113.61 ▼0.764.27 ▲2.2948.26 ▲4.41
Dashboard /wp-admin2,228 ▲435.78 ▲0.8993.95 ▼20.2440.60 ▼4.42
Posts /wp-admin/edit.php2,110 ▲212.07 ▲0.0534.33 ▼0.6935.53 ▲0.27
Add New Post /wp-admin/post-new.php1,536 ▼923.22 ▲5.08637.60 ▲41.8350.43 ▲1.03
Media Library /wp-admin/upload.php1,404 ▲134.30 ▼0.1194.66 ▼6.8339.82 ▼4.73
DMA WOO Modal Cart Lite /wp-admin/admin.php?page=dma-woo-modal-cart-lite7211.536.5720.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=dma-woo-modal-cart-lite
    • > Warning in wp-content/plugins/dma-woo-modal-cart-lite/inc/DWMCL_Frontend.php+477
    Use of undefined constant WC_VERSION - assumed 'WC_VERSION' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=dma-woo-modal-cart-lite
    • > Warning in wp-content/plugins/dma-woo-modal-cart-lite/inc/DWMCL_Utils.php+63
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
    • > GET request to /wp-admin/admin.php?page=dma-woo-modal-cart-lite
    • > Error in wp-content/plugins/dma-woo-modal-cart-lite/inc/DWMCL_Admin.php+232
    Uncaught Error: Call to undefined function DMAWMCA\wc_get_products() in wp-content/plugins/dma-woo-modal-cart-lite/inc/DWMCL_Admin.php:232
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): DMAWMCA\DWMCL_Admin->dma_options_page()
    #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/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/dma-woo-modal-cart-lite/DWMCL.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

dma-woo-modal-cart-lite/DWMCL.php 77% from 13 tests

The principal PHP file in "DMA WOO Modal Cart Lite" v. 1.0.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dma-woo-modal-cart-lite.php" instead of "DWMCL.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "4.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin24,875 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JSON30021,031
PHP1235,65057,3682,437
CSS6199291,027
JavaScript412732354
SVG10026

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity28.29
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods73
▷ Static methods1419.18%
▷ Public methods7298.63%
▷ Protected methods00.00%
▷ Private methods11.37%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants8
▷ Global constants337.50%
▷ Class constants562.50%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.29MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-256x256.png19.07KB7.28KB▼ 61.83%
assets/fonts/chosen-sprite.png0.53KB0.88KB0.00%
assets/images/ui-icons_ef8c08_256x240.png7.97KB4.21KB▼ 47.22%
assets/fonts/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/images/icon-128x128.png10.10KB3.98KB▼ 60.60%