57% displayproduct

Code Review | Product Catalog - Catalog for WordPress

WordPress plugin Product Catalog - Catalog for WordPress scored57%from 54 tests.

About plugin

  • Plugin page: displayproduct
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2019
  • Latest release: Jul 13, 2021
  • Number of updates: 6
  • Update frequency: every 105.8 days
  • Top authors: origincode (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

200+ active /14,794 total downloads

Benchmarks

Plugin footprint 65% 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.47MB] [CPU: ▼3.75ms] Passed 4 tests

A check of server-side resources used by Product Catalog - Catalog for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4139.93 ▼1.53
Dashboard /wp-admin3.76 ▲0.4655.24 ▲7.18
Posts /wp-admin/edit.php3.86 ▲0.5148.99 ▼7.00
Add New Post /wp-admin/post-new.php6.45 ▲0.5693.96 ▼4.99
Media Library /wp-admin/upload.php3.72 ▲0.4934.54 ▼1.46
Comments Manager /wp-admin/admin.php?page=origincode_reviews_page3.7035.84
Manage Catalogs /wp-admin/admin.php?page=catalogs_origin_code_catalog4.0639.84
Image View Options /wp-admin/admin.php?page=Options_catalog_lightbox_styles3.8336.47
Grid Styles /wp-admin/admin.php?page=Options_product_Catalog_styles4.4137.81
Single Product Styles /wp-admin/admin.php?page=origincode_products_page3.7332.96
Submissions Manager /wp-admin/admin.php?page=origin_code_catalog_submitions_page3.8138.40
Settings /wp-admin/admin.php?page=origin_code_catalog_general_options_page3.7335.38
Ratings Manager /wp-admin/admin.php?page=origincode_ratings_page3.6934.73

Server storage [IO: ▲2.81MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 181 new files
Database: 8 new tables, 7 new options
New tables
wp_origincode_asc_desc
wp_origincode_reviews
wp_origincode_rating
wp_origincode_products
wp_origincode_general_options
wp_origincode_catalog_album_contact
wp_origincode_catalog_albums
wp_origincode_catalogs
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_origincode_catalog_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Product Catalog - Catalog for WordPress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲22413.61 ▼0.777.97 ▲6.0339.08 ▼3.45
Dashboard /wp-admin2,249 ▲645.01 ▼0.85111.03 ▼2.8866.50 ▲20.48
Posts /wp-admin/edit.php2,158 ▲662.26 ▲0.2740.94 ▲2.9636.74 ▲3.72
Add New Post /wp-admin/post-new.php1,564 ▲2223.09 ▲4.88668.88 ▲56.8656.57 ▲5.91
Media Library /wp-admin/upload.php1,456 ▲684.44 ▲0.2699.71 ▼3.1564.02 ▲18.93
Comments Manager /wp-admin/admin.php?page=origincode_reviews_page1,6811.9331.2633.31
Manage Catalogs /wp-admin/admin.php?page=catalogs_origin_code_catalog1,1633.2542.2369.60
Image View Options /wp-admin/admin.php?page=Options_catalog_lightbox_styles2,2183.8558.6292.86
Grid Styles /wp-admin/admin.php?page=Options_product_Catalog_styles6,1193.9381.88126.93
Single Product Styles /wp-admin/admin.php?page=origincode_products_page1,6702.1937.5744.98
Submissions Manager /wp-admin/admin.php?page=origin_code_catalog_submitions_page1,2193.3442.6675.88
Settings /wp-admin/admin.php?page=origin_code_catalog_general_options_page2,2538.33165.35137.35
Ratings Manager /wp-admin/admin.php?page=origincode_ratings_page1,4591.9528.9031.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables were found after uninstall: 8 tables
    • wp_origincode_products
    • wp_origincode_catalogs
    • wp_origincode_general_options
    • wp_origincode_reviews
    • wp_origincode_catalog_album_contact
    • wp_origincode_asc_desc
    • wp_origincode_rating
    • wp_origincode_catalog_albums
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_origincode_catalog_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=origin_code_catalog_general_options_page
    • > User deprecated in wp-includes/functions.php+5828
    Hook media_buttons_context is deprecated since version 3.5.0! Use media_buttons instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/displayproduct/views/front_view_height_all.php
    • > /wp-content/plugins/displayproduct/views/pagination.php
    • > /wp-content/plugins/displayproduct/views/front_view_width_all.php
  • 650× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/displayproduct/views/front_view_height_all.php on line 293
    • > PHP Notice
      Undefined variable: sorting_block_width in wp-content/plugins/displayproduct/views/front_view_width_all.php on line 320
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/displayproduct/views/front_view_width_all.php on line 520
    • > PHP Notice
      Undefined variable: catalogID in wp-content/plugins/displayproduct/views/front_view_width_all.php on line 272
    • > PHP Notice
      Undefined variable: catalogID in wp-content/plugins/displayproduct/views/front_view_height_all.php on line 138
    • > PHP Notice
      Undefined variable: catalogID in wp-content/plugins/displayproduct/views/front_view_width_all.php on line 518
    • > PHP Notice
      Undefined variable: catalogID in wp-content/plugins/displayproduct/views/front_view_height_all.php on line 150
    • > PHP Notice
      Undefined variable: productArray in wp-content/plugins/displayproduct/views/front_single_product.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/displayproduct/views/front_view_width_all.php on line 175
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/displayproduct/views/front_view_width_all.php on line 432

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=origincode_reviews_page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).masonry is not a function" "TypeError: jQuery(...).masonry is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/displayproduct/assets/js/admin.js?ver=6.3.1:96:46)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=origincode_reviews_page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).masonry is not a function
    • > GET request to /wp-admin/admin.php?page=origin_code_catalog_general_options_page
    • > Network (severe)
    wp-content/plugins/displayproduct/images/small-icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: products catalog, catalog, product catalogue, goods catalog, product catalog

displayproduct/displayproduct.php 92% from 13 tests

The principal PHP file in "Product Catalog - Catalog for WordPress" v. 1.0.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected28,660 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP282,19773916,429
CSS168087915,822
JavaScript136802563,831
SVG1102,569
HTML1309

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions72
▷ Named functions72100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
71 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/elements/jscolor/hs.png2.62KB7.54KB0.00%
assets/images/zoom.light.png1.55KB1.75KB0.00%
assets/images/small-icon.png1.90KB0.77KB▼ 59.17%
assets/images/share.buttons.2.png1.44KB1.60KB0.00%
assets/images/5/controls.png1.99KB2.04KB0.00%