78% merchiumru

Code Review | Онлайн-магазин Мерчиум

WordPress plugin Онлайн-магазин Мерчиум scored78%from 54 tests.

About plugin

  • Plugin page: merchiumru
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2014
  • Latest release: Dec 29, 2015
  • Number of updates: 10
  • Update frequency: every 45.3 days
  • Top authors: merchium (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,672 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
Installer ran successfully

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

Server-side resources used by Онлайн-магазин Мерчиум
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1344.66 ▲0.16
Dashboard /wp-admin3.43 ▲0.1353.64 ▲3.41
Posts /wp-admin/edit.php3.55 ▲0.1956.64 ▼2.83
Add New Post /wp-admin/post-new.php6.03 ▲0.1596.97 ▼14.30
Media Library /wp-admin/upload.php3.36 ▲0.1337.49 ▲2.14

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
merchium_show_vote_message
merchium_widget_code
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
merchium_installation_date
can_compress_scripts
merchium_store_page_id
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Онлайн-магазин Мерчиум
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲4013.21 ▼1.154.82 ▲2.3641.03 ▼9.48
Dashboard /wp-admin2,235 ▲585.85 ▲0.2788.74 ▼4.8243.75 ▲4.30
Posts /wp-admin/edit.php2,139 ▲392.45 ▲0.4938.59 ▼1.0735.93 ▲2.20
Add New Post /wp-admin/post-new.php1,560 ▲2323.79 ▲5.52647.68 ▼5.8034.62 ▼30.38
Media Library /wp-admin/upload.php1,440 ▲374.51 ▲0.2998.86 ▼0.1047.62 ▲4.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 11 options in the database
    • merchium_show_vote_message
    • merchium_widget_code
    • db_upgraded
    • can_compress_scripts
    • merchium_widget_is_connected
    • merchium_installation_date
    • widget_recent-comments
    • merchium_store_page_id
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/merchiumru/lib/pest/examples/intouch_example.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/merchiumru/php/content.admin_merchium.php:6
    • > 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/merchiumru/lib/pest/PestXML.php:72
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/merchiumru/php/content.admin_merchium_popup.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/merchiumru/merchium.php:12
    • > PHP Notice
      Undefined variable: code in wp-content/plugins/merchiumru/php/content.admin_merchium_popup.php on line 1
    • > PHP Fatal error
      Uncaught Pest_Curl_Exec: Failed to connect to localhost port 3000: Connection refused in wp-content/plugins/merchiumru/lib/pest/Pest.php:232
    • > PHP Notice
      Undefined variable: contactId in wp-content/plugins/merchiumru/lib/pest/examples/intouch_example.php on line 71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/merchiumru/php/content.admin_merchium_popup.php:15
    • > PHP Notice
      Undefined variable: contactId in wp-content/plugins/merchiumru/lib/pest/examples/intouch_example.php on line 89
    • > PHP Notice
      Undefined variable: code in wp-content/plugins/merchiumru/php/content.admin_merchium_popup.php on line 3

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4, #5, #6, #7 in merchiumru/assets to your readme.txt
You can take inspiration from this readme.txt

merchiumru/merchium.php 85% from 13 tests

"Онлайн-магазин Мерчиум" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Make the plugin description longer than 10 characters (currently 8 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("merchiumru.php" instead of "merchium.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected2,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

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
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/merchium-icon-default.png0.34KB0.32KB▼ 7.65%
images/merchium-store.png6.00KB3.14KB▼ 47.68%
images/popup_close_icon.png1.15KB1.00KB▼ 13.03%
images/merchium-icon-active.png0.36KB0.33KB▼ 8.77%