94% demomentsomtres-woocommerce-minimum-purchase-message

Code Review | DeMomentSomTres Woocommerce Minimum Purchase

WordPress plugin DeMomentSomTres Woocommerce Minimum Purchase scored 94% from 53 tests.

About plugin

  • Plugin page: demomentsomtres-w...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.2.3
  • WordPress version: 5.8.1
  • First release: Jul 29, 2015
  • Latest release: Jul 29, 2015
  • Number of updates: 5
  • Update frequency: every 71.4 days
  • Top authors: marcqueralt (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 578 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.29MB] [CPU: ▼272.06ms] Passed 4 tests

An overview of server-side resources used by DeMomentSomTres Woocommerce Minimum Purchase
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.3637.65 ▲17.36
Dashboard /wp-admin3.38 ▲0.3244.70 ▲1.33
Posts /wp-admin/edit.php3.42 ▲0.3245.22 ▼7.53
Add New Post /wp-admin/post-new.php5.68 ▲0.2588.65 ▼1,077.70
Media Library /wp-admin/upload.php3.26 ▲0.2537.50 ▼4.35
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.2829.67

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for DeMomentSomTres Woocommerce Minimum Purchase
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,720 ▲11415.82 ▲0.218.52 ▲0.4850.62 ▼0.86
Dashboard /wp-admin2,974 ▲1245.88 ▼0.05139.54 ▼1.98111.88 ▲12.80
Posts /wp-admin/edit.php2,761 ▲582.70 ▼0.0064.01 ▼2.1594.42 ▲3.76
Add New Post /wp-admin/post-new.php1,516 ▼15218.32 ▼0.44352.98 ▲6.01111.00 ▼1.23
Media Library /wp-admin/upload.php1,833 ▲615.07 ▲0.05151.84 ▼6.04116.85 ▼1.50
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,2472.1150.2057.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 2× 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/demomentsomtres-woocommerce-minimum-purchase-message/lib/class-tgm-plugin-activation.php:161
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/demomentsomtres-woocommerce-minimum-purchase-message/lib/class-tgm-plugin-activation.php:161

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: minimum purchase, woocommerce

demomentsomtres-woocommerce-minimum-purchase-message/demomentsomtres-WC-minimum-purchase-message.php 85% from 13 tests

The principal PHP file in "DeMomentSomTres Woocommerce Minimum Purchase" v. 0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.9.1" instead of "3.9")
  • Main file name: The principal plugin file should be the same as the plugin slug ("demomentsomtres-woocommerce-minimum-purchase-message.php" instead of "demomentsomtres-WC-minimum-purchase-message.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
There were no executable files found in this plugin1,668 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP23798091,238
PO File283124287
Markdown1500143

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity42.00
▷ Minimum class complexity4.00
▷ Maximum class complexity112.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods50
▷ Static methods12.00%
▷ Public methods4386.00%
▷ Protected methods612.00%
▷ Private methods12.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants116.67%
▷ Class constants583.33%
▷ Public constants5100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin