77% hoplix-print-on-demand-platform

Code Review | Hoplix Integration for WooCommerce

WordPress plugin Hoplix Integration for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: hoplix-print-on-d...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.2.1
  • WordPress version: 6.3.1
  • First release: Dec 10, 2020
  • Latest release: Jun 5, 2023
  • Number of updates: 17
  • Update frequency: every 53.4 days
  • Top authors: hoplix (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /5,588 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▲1.58ms] Passed 4 tests

An overview of server-side resources used by Hoplix Integration for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.72 ▼0.63
Dashboard /wp-admin3.32 ▲0.0150.11 ▼3.80
Posts /wp-admin/edit.php3.37 ▲0.0156.65 ▲6.37
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.55 ▲4.95
Media Library /wp-admin/upload.php3.24 ▲0.0140.91 ▲5.80

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Hoplix Integration for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.121.78 ▲0.0045.47 ▼1.31
Dashboard /wp-admin2,195 ▲155.54 ▼0.1489.54 ▼11.9841.57 ▼4.38
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0039.91 ▲2.9437.03 ▲0.60
Add New Post /wp-admin/post-new.php1,526 ▼223.59 ▲0.57649.31 ▼13.0154.62 ▲1.65
Media Library /wp-admin/upload.php1,400 ▼34.18 ▼0.0495.09 ▼6.5541.74 ▼1.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/footer.php
    • > /wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/header.php
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/setting-group.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/order-table-wc.php:147
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/stats.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/connect.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/quick-links.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/order-table.php:66
    • > PHP Notice
      Undefined variable: disabled in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/setting-submit.php on line 7
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/header.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/ajax-loader.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/hoplix-print-on-demand-platform/includes/templates/error.php:1

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, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

hoplix-print-on-demand-platform/hoplix-integration.php 77% from 13 tests

The entry point to "Hoplix Integration for WooCommerce" version 1.0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.9" instead of "3.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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hoplix-print-on-demand-platform.php" instead of "hoplix-integration.php")

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
Everything looks great! No dangerous files found in this plugin2,027 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP232,6554451,655
CSS3222207
JavaScript51042165

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods91
▷ Static methods3134.07%
▷ Public methods6874.73%
▷ Protected methods00.00%
▷ Private methods2325.27%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants00.00%
▷ Class constants22100.00%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/hoplix-logo-footer.png2.73KB1.07KB▼ 60.78%
assets/images/connect.png9.59KB4.85KB▼ 49.43%
assets/images/hoplix-menu-icon.png0.87KB0.46KB▼ 47.19%