78% merchium

Code Review | Merchium Shopping Cart

WordPress plugin Merchium Shopping Cart scored78%from 54 tests.

About plugin

  • Plugin page: merchium
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.1
  • WordPress version: 6.3.1
  • First release: Dec 22, 2014
  • Latest release: May 20, 2015
  • Number of updates: 9
  • Update frequency: every 16.7 days
  • Top authors: merchium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,914 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.99ms] Passed 4 tests

This is a short check of server-side resources used by Merchium Shopping Cart
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1336.15 ▼4.67
Dashboard /wp-admin3.43 ▲0.0948.47 ▼13.98
Posts /wp-admin/edit.php3.55 ▲0.1948.55 ▲2.68
Add New Post /wp-admin/post-new.php6.03 ▲0.1594.05 ▲0.02
Media Library /wp-admin/upload.php3.35 ▲0.1338.31 ▲4.44

Server storage [IO: ▲0.16MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
merchium_installation_date
merchium_store_page_id
merchium_show_vote_message
merchium_widget_is_connected
merchium_widget_code
...

Browser metrics Passed 4 tests

An overview of browser requirements for Merchium Shopping Cart
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲4013.16 ▼1.501.85 ▼0.0243.54 ▼0.42
Dashboard /wp-admin2,232 ▲585.88 ▲0.21102.85 ▼1.6145.27 ▲0.99
Posts /wp-admin/edit.php2,139 ▲392.48 ▲0.4842.82 ▲7.4336.96 ▲1.03
Add New Post /wp-admin/post-new.php1,560 ▲2323.16 ▲5.08689.32 ▲31.0336.04 ▼27.44
Media Library /wp-admin/upload.php1,431 ▲344.48 ▲0.2297.52 ▼8.1647.10 ▲1.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 11 options
    • merchium_show_vote_message
    • merchium_widget_code
    • merchium_store_page_id
    • db_upgraded
    • merchium_installation_date
    • can_compress_scripts
    • theysaidso_admin_options
    • merchium_widget_is_connected
    • widget_recent-comments
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/merchium/lib/pest/examples/intouch_example.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: code in wp-content/plugins/merchium/php/content.admin_merchium_popup.php on line 3
    • > PHP Notice
      Undefined variable: contactId in wp-content/plugins/merchium/lib/pest/examples/intouch_example.php on line 89
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/merchium/php/content.admin_merchium.php:6
    • > PHP Notice
      Undefined variable: contactId in wp-content/plugins/merchium/lib/pest/examples/intouch_example.php on line 71
    • > PHP Fatal error
      Uncaught Pest_Curl_Exec: Failed to connect to localhost port 3000: Connection refused in wp-content/plugins/merchium/lib/pest/Pest.php:232
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/merchium/merchium.php:12
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/merchium/php/content.admin_merchium_popup.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/merchium/php/content.admin_merchium_popup.php:15
    • > PHP Fatal error
      Uncaught PestXML_Exception: Couldn't parse XML response because: - Space required after the Public Identifier - SystemLiteral " or ' expected - SYSTEM or PUBLIC, the URI is missing - Opening and ending tag mismatch: hr line 0 and body - Opening and ending tag mismatch: body line 0 and html - EndTag: '</' not foundThe response was:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>301 Moved Permanently</title></head><body><h1>Moved Permanently</h1><p>The document has moved <a href="https://www.openstreetmap.org/api/0.6/map?bbox=-79.39997,43.65827,-79.39344,43.66903">here</a>.</p><hr><address>Apache/2.4.54 (Ubuntu) Server at api.openstreetmap.org Port 80</address></body></html> in wp-content/plugins/merchium/lib/pest/PestXML.php:72
    • > PHP Notice
      Undefined variable: code in wp-content/plugins/merchium/php/content.admin_merchium_popup.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === merchium === )
  • Screenshots: Add descriptions for screenshots #2, #3, #4, #5, #6, #7 in merchium/assets to your readme.txt
You can take inspiration from this readme.txt

merchium/merchium.php 92% from 13 tests

The main file in "Merchium Shopping Cart" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: The plugin description must be longer than 10 characters (currently 8 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,482 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP153673921,535
CSS4394426
JavaScript2619299
Markdown139092
PO File137080
SVG20027
JSON10023

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.71
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods57
▷ Static methods23.51%
▷ Public methods3866.67%
▷ Protected methods1729.82%
▷ Private methods23.51%
Functions37
▷ Named functions3697.30%
▷ Anonymous functions12.70%
Constants11
▷ Global constants981.82%
▷ Class constants218.18%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/popup_close_icon.png1.15KB1.00KB▼ 13.03%
images/merchium-store.png6.00KB3.14KB▼ 47.68%
images/merchium-icon-active.png0.36KB0.33KB▼ 8.77%
images/merchium-icon-default.png0.34KB0.32KB▼ 7.65%