72% dynamic-product-categories-design

Code Review | Dynamic Product Categories Design

WordPress plugin Dynamic Product Categories Design scored72%from 54 tests.

About plugin

  • Plugin page: dynamic-product-c...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 13, 2022
  • Latest release: Aug 7, 2023
  • Number of updates: 22
  • Update frequency: every 10.8 days
  • Top authors: maidulcu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /928 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▲2.74ms] Passed 4 tests

An overview of server-side resources used by Dynamic Product Categories Design
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1649.12 ▲10.44
Dashboard /wp-admin3.48 ▲0.1850.21 ▼2.90
Posts /wp-admin/edit.php3.53 ▲0.1754.74 ▲5.29
Add New Post /wp-admin/post-new.php6.08 ▲0.2099.31 ▲8.19
Media Library /wp-admin/upload.php3.40 ▲0.1738.35 ▲0.38
Add New /wp-admin/post-new.php?post_type=dpcd_category_design3.8349.02
All Designs /wp-admin/edit.php?post_type=dpcd_category_design3.4535.80

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 374 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
wc_pcd_version
wc_pcd_installed
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Dynamic Product Categories Design
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8914.80 ▲0.451.83 ▲0.2043.63 ▲2.31
Dashboard /wp-admin2,236 ▲595.69 ▲0.1085.54 ▼7.7939.46 ▼16.93
Posts /wp-admin/edit.php2,141 ▲382.06 ▲0.0440.80 ▼1.2336.31 ▼0.14
Add New Post /wp-admin/post-new.php1,559 ▲3323.92 ▲1.03649.82 ▼25.0049.62 ▼12.42
Media Library /wp-admin/upload.php1,435 ▲354.29 ▲0.1299.15 ▼5.6343.30 ▼4.27
Add New /wp-admin/post-new.php?post_type=dpcd_category_design1,7442.7854.9361.70
All Designs /wp-admin/edit.php?post_type=dpcd_category_design1,1101.9634.6828.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • wc_pcd_version
    • wc_pcd_installed
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=dpcd_category_design
    • > Notice in wp-content/plugins/dynamic-product-categories-design/include/functions.php+27
    Trying to get property 'slug' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=dpcd_category_design
    • > Notice in wp-content/plugins/dynamic-product-categories-design/include/functions.php+27
    Trying to get property 'name' of non-object

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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dynamic-product-categories-design/pcd-templates/template-grid.php
  • 42× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/CMB2.php:21
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/dynamic-product-categories-design/pcd-templates/template-grid.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/dynamic-product-categories-design/lib/cmb2/includes/CMB2_Field.php:17

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed: The official readme.txt might help

dynamic-product-categories-design/dynamic-product-category-design.php 85% from 13 tests

The entry point to "Dynamic Product Categories Design" version 1.0.6 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("dynamic-product-categories-design.php" instead of "dynamic-product-category-design.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected47,389 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP652,3556,5647,823
CSS152751,1944,941
JavaScript103926051,520
Markdown32490768
SVG11014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity18.07
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes74
▷ Abstract classes912.16%
▷ Concrete classes6587.84%
▷ Final classes11.54%
Methods565
▷ Static methods9216.28%
▷ Public methods47283.54%
▷ Protected methods8915.75%
▷ Private methods40.71%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants853.33%
▷ Class constants746.67%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
lib/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
assets/images/overlay-content.png2.03KB1.83KB▼ 9.80%
assets/images/slider.png1.67KB1.13KB▼ 32.18%
lib/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%