78% zpr-zeumic-products-database

Code Review | ZPR Zeumic Products Database

WordPress plugin ZPR Zeumic Products Database scored78%from 54 tests.

About plugin

  • Plugin page: zpr-zeumic-produc...
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 5, 2017
  • Latest release: Jun 14, 2023
  • Number of updates: 52
  • Update frequency: every 44.0 days
  • Top authors: zeumic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,274 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▲1.99ms] Passed 4 tests

An overview of server-side resources used by ZPR Zeumic Products Database
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2238.87 ▼4.84
Dashboard /wp-admin3.70 ▲0.4058.92 ▲10.41
Posts /wp-admin/edit.php3.75 ▲0.3959.93 ▲8.86
Add New Post /wp-admin/post-new.php6.26 ▲0.3795.86 ▼6.48
Media Library /wp-admin/upload.php3.56 ▲0.3349.57 ▲10.66
Fields /wp-admin/admin.php?page=zpr-fields3.5348.75
Use ZPR /wp-admin/admin.php?page=zpr3.5135.07
Settings /wp-admin/admin.php?page=zpr-settings3.5341.12

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 58 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
zpr_version
widget_recent-comments
recovery_mode_email_last_sent
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for ZPR Zeumic Products Database
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8814.35 ▼0.031.85 ▲0.2542.02 ▲0.84
Dashboard /wp-admin2,246 ▲695.58 ▲0.0184.79 ▼3.9942.09 ▲1.86
Posts /wp-admin/edit.php2,148 ▲482.02 ▼0.0139.08 ▲4.4638.82 ▲2.69
Add New Post /wp-admin/post-new.php1,570 ▲4423.04 ▼0.65660.56 ▼37.2451.37 ▼3.30
Media Library /wp-admin/upload.php1,451 ▲514.20 ▲0.02110.55 ▼5.1147.67 ▲2.49
Fields /wp-admin/admin.php?page=zpr-fields1,3752.3229.9831.06
Use ZPR /wp-admin/admin.php?page=zpr7441.516.6820.41
Settings /wp-admin/admin.php?page=zpr-settings1,0362.1726.6127.73

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • zpr_version
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=zpr
    • > Notice in wp-content/plugins/zpr-zeumic-products-database/src/ProductUtil/general.php+40
    Trying to get property 'term_id' of non-object
    • > GET request to /wp-admin/admin.php?page=zpr
    • > Notice in wp-content/plugins/zpr-zeumic-products-database/src/ProductUtil/general.php+41
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/admin.php?page=zpr
    • > Error in wp-content/plugins/zpr-zeumic-products-database/src/ProductUtil/general.php+43
    Uncaught Error: Object of class WP_Error could not be converted to string in wp-content/plugins/zpr-zeumic-products-database/src/ProductUtil/general.php:43
    Stack trace:
    #0 wp-content/plugins/zpr-zeumic-products-database/src/Plugin.php(821): Zeumic\ZPR\Core\get_all_categories()
    #1 wp-content/plugins/zpr-zeumic-products-database/src/Plugin.php(881): Zeumic\ZPR\Core\Plugin->output_grid()
    #2 wp-includes/shortcodes.php(395): Zeumic\ZPR\Core\Plugin->shortcode_list()
    #3 [internal function]: do_shortcode_tag()
    #4 wp-includes/shortcodes.php(235): preg_replace_callback()
    #5 wp-content/plugins/zpr-zeumic-products-database/src/Plugin.php(390): do_shortcode()
    #6 wp-includes/class-wp-hook.php(310): Zeumic\ZPR\Core\Plugin->output_page_use_zpr()
    #7 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #8 wp-includes/plugin.php(517): WP_Hook->do_actio

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
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\Plugin' not found in wp-content/plugins/zpr-zeumic-products-database/zsc/src/PluginDistributable.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\Singleton' not found in wp-content/plugins/zpr-zeumic-products-database/zsc/src/Plugin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/zpr-zeumic-products-database/zsc/zsc-zeumic-suite-common.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\PluginDistributable' not found in wp-content/plugins/zpr-zeumic-products-database/zsc/src/PluginCore.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\Singleton' not found in wp-content/plugins/zpr-zeumic-products-database/zsc/src/PluginLoader.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/zpr-zeumic-products-database/zsc/zsc-zeumic-suite-common.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\PluginCore' not found in wp-content/plugins/zpr-zeumic-products-database/src/Plugin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Zeumic\\ZSC\\Core\\trailingslashit() in wp-content/plugins/zpr-zeumic-products-database/zsc/load.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\Plugin' not found in wp-content/plugins/zpr-zeumic-products-database/zsc/src/Common.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Zeumic\\ZSC\\Core\\PluginDistributable' not found in wp-content/plugins/zpr-zeumic-products-database/zsc/src/PluginExt.php:4

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
You can look at the official readme.txt

zpr-zeumic-products-database/zpr-zeumic-products-database.php 85% from 13 tests

The principal PHP file in "ZPR Zeumic Products Database" v. 1.8.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 289 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin7,269 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript208313123,514
PHP194911,0402,806
CSS916984949

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity31.75
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes12
▷ Abstract classes541.67%
▷ Concrete classes758.33%
▷ Final classes00.00%
Methods175
▷ Static methods52.86%
▷ Public methods16091.43%
▷ Protected methods52.86%
▷ Private methods105.71%
Functions45
▷ Named functions2657.78%
▷ Anonymous functions1942.22%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
zsc/img/refresh.png14.89KB0.50KB▼ 96.65%
zsc/vendor/jquery-ui/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
zsc/vendor/jquery-ui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
zsc/vendor/jquery-ui/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
zsc/vendor/jquery-ui/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%