53% merchr-print-on-demand

Code Review | Merchr Print on Demand UK

WordPress plugin Merchr Print on Demand UK scored53%from 54 tests.

About plugin

  • Plugin page: merchr-print-on-d...
  • Plugin version: 1.1.5
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 10, 2023
  • Latest release: Nov 30, 2023
  • Number of updates: 53
  • Update frequency: every 4.8 days
  • Top authors: merchr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,537 total downloads

Benchmarks

Plugin footprint 30% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.04ms] Passed 4 tests

A check of server-side resources used by Merchr Print on Demand UK
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.90 ▼6.41
Dashboard /wp-admin3.31 ▲0.0046.55 ▼2.87
Posts /wp-admin/edit.php3.36 ▲0.0049.64 ▼1.21
Add New Post /wp-admin/post-new.php5.89 ▲0.00106.63 ▲16.42
Media Library /wp-admin/upload.php3.23 ▲0.0036.18 ▲2.34

Server storage [IO: ▲1.98MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 324 new files
Database: 4 new tables, 11 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_actions
wp_actionscheduler_groups
wp_actionscheduler_claims
New WordPress options
widget_recent-posts
theysaidso_admin_options
Activated_Plugin
db_upgraded
widget_theysaidso_widget
action_scheduler_lock_async-request-runner
schema-ActionScheduler_StoreSchema
can_compress_scripts
action_scheduler_hybrid_store_demarkation
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Merchr Print on Demand UK
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.14 ▼0.212.32 ▲0.6038.69 ▼4.26
Dashboard /wp-admin2,195 ▲175.61 ▼0.1490.41 ▼22.9543.01 ▲2.02
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0939.07 ▼0.8637.36 ▲4.80
Add New Post /wp-admin/post-new.php1,526 ▼023.21 ▼0.25651.25 ▲39.0751.79 ▲7.97
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.03106.25 ▲8.8546.94 ▲4.02

Uninstaller [IO: ▲1.98MB] [DB: ▲0.01MB] 0% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/merchr-print-on-demand/uninstall.php+39
    Undefined index: plugin
  • This plugin has failed uninstalling correctly, leaving 324 files (1.98MB) in the plugin directory
    • (new file) LICENSE.txt
    • (new file) hub/admin/css/images/index.php
    • (new file) hub/admin/css/images/ui-icons_777777_256x240.png
    • (new file) hub/admin/css/admin.css
    • (new file) hub/admin/css/images/ui-icons_777620_256x240.png
    • (new file) hub/admin/css/images/ui-icons_555555_256x240.png
    • (new file) hub/admin/css/images/ui-icons_444444_256x240.png
    • (new file) hub/admin/css/featherlight.css
    • (new file) hub/admin/css/images/ui-icons_cc0000_256x240.png
    • (new file) hub/admin/css/images/ui-icons_ffffff_256x240.png
    • ...
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_actionscheduler_groups
    • wp_actionscheduler_logs
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
  • Zombie WordPress options detected upon uninstall: 11 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • Activated_Plugin
    • action_scheduler_hybrid_store_demarkation
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • action_scheduler_lock_async-request-runner
    • schema-ActionScheduler_StoreSchema
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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 fix the following items
  • 50× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/defuse/php-encryption/src/Exception/IOException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpCommentLogger.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_DBStore' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php:10
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_ListTable' not found in wp-content/plugins/merchr-print-on-demand/hub/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ListTable.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'other/ide_stubs/libsodium.php' (include_path='.:/usr/share/php') in wp-content/plugins/merchr-print-on-demand/hub/vendor/paragonie/random_compat/psalm-autoload.php on line 6

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 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: personalised products, personalisation, merchandise, merchr, personalised merchandise...

merchr-print-on-demand/merchr.php 69% from 13 tests

The primary PHP file in "Merchr Print on Demand UK" version 1.1.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("merchr-print-on-demand.php" instead of "merchr.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.0.0")
  • 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
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.0" instead of "7.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected22,234 lines of code in 268 files:
LanguageFilesBlank linesComment linesLines of code
PHP1963,3659,38215,887
JavaScript103816062,433
Markdown1358601,503
Sass20198111,384
CSS617050435
JSON500270
Smarty14230262
make19426
XML10019
SVG10012
Bourne Shell1203

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity10.41
▷ Minimum class complexity1.00
▷ Maximum class complexity122.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces19
Interfaces3
Traits4
Classes162
▷ Abstract classes159.26%
▷ Concrete classes14790.74%
▷ Final classes74.76%
Methods998
▷ Static methods19219.24%
▷ Public methods75775.85%
▷ Protected methods17217.23%
▷ Private methods696.91%
Functions44
▷ Named functions3477.27%
▷ Anonymous functions1022.73%
Constants89
▷ Global constants1011.24%
▷ Class constants7988.76%
▷ Public constants79100.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
11 PNG files occupy 0.20MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
hub/admin/images/merchr-icon.png44.22KB14.98KB▼ 66.13%
hub/admin/css/images/ui-icons_777777_256x240.png7.00KB4.18KB▼ 40.22%
hub/admin/css/images/ui-icons_ffffff_256x240.png6.39KB4.18KB▼ 34.52%
hub/admin/css/images/ui-icons_444444_256x240.png6.97KB4.18KB▼ 40.04%
hub/admin/css/images/ui-icons_555555_256x240.png6.96KB4.18KB▼ 39.91%