10% zencart-products

Code Review | ZenCart Products Display

WordPress plugin ZenCart Products Display scored10%from 54 tests.

About plugin

  • Plugin page: zencart-products
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.7.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2013
  • Latest release: Nov 9, 2013
  • Number of updates: 6
  • Update frequency: every 4.2 days
  • Top authors: techize (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,806 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/zencart-products/lib/query_factory.php+547
    Methods with the same name as their class will not be constructors in a future version of PHP; queryFactoryMeta has a deprecated constructor

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

An overview of server-side resources used by ZenCart Products Display
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.42 ▼5.66
Dashboard /wp-admin3.31 ▲0.0044.94 ▼3.09
Posts /wp-admin/edit.php3.36 ▲0.0046.07 ▲1.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.57 ▼10.56
Media Library /wp-admin/upload.php3.23 ▲0.0035.66 ▲2.68

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

ZenCart Products Display: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.17 ▼1.201.95 ▼0.0742.45 ▲1.10
Dashboard /wp-admin2,206 ▲184.86 ▼0.01107.22 ▼1.0939.51 ▼3.28
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0042.36 ▲5.2435.98 ▼0.15
Add New Post /wp-admin/post-new.php1,533 ▲1423.05 ▼0.39664.77 ▲17.5952.46 ▼2.55
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0098.63 ▲3.5142.81 ▲1.43

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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 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 fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/zencart-products/lib/query_factory.php
    • > /wp-content/plugins/zencart-products/lib/functions_general.php
    • > /wp-content/plugins/zencart-products/lib/define_queries.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zencart-products/views/zencart_products_admin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zencart-products/lib/zencart_db_methods.php:10
    • > PHP Notice
      Undefined index: zenfpd_hidden in wp-content/plugins/zencart-products/views/zencart_products_admin.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zencart-products/lib/zencart_db_methods.php:10

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

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: zencart, featured products, new products, ecommerce, special products

zencart-products/zencart_options.php 85% from 13 tests

The main PHP file in "ZenCart Products Display" ver. 2.1.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("zencart-products.php" instead of "zencart_options.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,518 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP84475832,518

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity16.50
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods47
▷ Static methods00.00%
▷ Public methods47100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions117
▷ Named functions117100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected