63% product-layouts

Code Review | Product Layouts for Woocommerce ( Product Gallery, Product Showcase, Layout Design, Category Tabs, Product Slider, Product Grid, Product Table )

WordPress plugin Product Layouts for Woocommerce ( Product Gallery, Product Showcase, Layout Design, Category Tabs, Product Slider, Product Grid, Product Table ) scored63%from 54 tests.

About plugin

  • Plugin page: product-layouts
  • Plugin version: 1.1.8
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Apr 14, 2022
  • Latest release: Nov 15, 2023
  • Number of updates: 58
  • Update frequency: every 10.2 days
  • Top authors: richardmallick (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /5,583 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.11MB] [CPU: ▲26.24ms] 75% from 4 tests

A check of server-side resources used by Product Layouts for Woocommerce ( Product Gallery, Product Showcase, Layout Design, Category Tabs, Product Slider, Product Grid, Product Table )
It is recommended to improve the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.11MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.94 ▲5.4863.60 ▲18.65
Dashboard /wp-admin8.96 ▲5.6284.40 ▲23.49
Posts /wp-admin/edit.php8.96 ▲5.6081.63 ▲35.43
Add New Post /wp-admin/post-new.php9.62 ▲3.74120.01 ▲27.37
Media Library /wp-admin/upload.php8.96 ▲5.7377.07 ▲43.86
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9657.42

Server storage [IO: ▲7.29MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 355 new files
Database: 1 new table, 12 new options
New tables
wp_wpte_product_layout_style
New WordPress options
db_upgraded
fs_debug_mode
WPTE_wpl_installed
fs_accounts
WPTE_wpl_version
can_compress_scripts
theysaidso_admin_options
WPTE_wpl_activation_redirect
widget_theysaidso_widget
fs_active_plugins
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Layouts for Woocommerce ( Product Gallery, Product Showcase, Layout Design, Category Tabs, Product Slider, Product Grid, Product Table )
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,051 ▲30414.57 ▲0.231.68 ▼0.5431.13 ▼20.83
Dashboard /wp-admin2,436 ▲2585.54 ▼0.1596.46 ▼11.1265.50 ▲17.91
Posts /wp-admin/edit.php2,318 ▲2182.11 ▲0.1039.06 ▼0.8739.15 ▲2.20
Add New Post /wp-admin/post-new.php1,470 ▼5618.03 ▼5.01641.31 ▼1.8844.02 ▼15.25
Media Library /wp-admin/upload.php1,681 ▲2784.25 ▲0.0699.59 ▲0.7784.09 ▲41.85
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,2621.6528.3029.60

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 25% 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
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/product-layouts/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_wpte_product_layout_style
  • The uninstall procedure has failed, leaving 12 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • WPTE_wpl_version
    • widget_recent-posts
    • WPTE_wpl_installed
    • fs_accounts
    • fs_active_plugins
    • WPTE_wpl_activation_redirect
    • fs_debug_mode
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 54× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Includes\\Admin\\Pages\\Create' not found in wp-content/plugins/product-layouts/Layouts/Caption/Caption.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Includes\\Admin\\Pages\\AdminRender' not found in wp-content/plugins/product-layouts/Layouts/Table/Layout.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Layouts\\General\\Layout' not found in wp-content/plugins/product-layouts/Layouts/General/Backend/Layout2.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Layouts\\General\\Layout' not found in wp-content/plugins/product-layouts/Layouts/General/Backend/Layout6.php:11
    • > PHP Fatal error
      Trait 'WPTE_PRODUCT_LAYOUT\\Includes\\Admin\\Pages\\AdminTopMenu' not found in wp-content/plugins/product-layouts/Includes/Admin/Menu.php on line 10
    • > PHP Warning
      require(ABSPATHwp-admin/includes/class-wp-links-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/product-layouts/Includes/Admin/Pages/Layout_list/Layouts_List.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Includes\\Admin\\Pages\\Create' not found in wp-content/plugins/product-layouts/Layouts/Call_to_action/Call_to_action.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/product-layouts/Includes/functions.php:252
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Layouts\\Caption\\Layout' not found in wp-content/plugins/product-layouts/Layouts/Caption/Backend/Layout3.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPTE_PRODUCT_LAYOUT\\Includes\\Admin\\Pages\\AdminRender' not found in wp-content/plugins/product-layouts/Layouts/Carousel/Layout.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

product-layouts/product-layouts.php 92% from 13 tests

This is the main PHP file of "Product Layouts for Woocommerce ( Product Gallery, Product Showcase, Layout Design, Category Tabs, Product Slider, Product Grid, Product Table )" version 1.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected73,111 lines of code in 300 files:
LanguageFilesBlank linesComment linesLines of code
PHP23111,18720,86060,280
JavaScript219297766,062
CSS315431865,250
SVG15178111,300
Markdown1680214
JSON1005

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity40.51
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces36
Interfaces1
Traits3
Classes153
▷ Abstract classes31.96%
▷ Concrete classes15098.04%
▷ Final classes21.33%
Methods1,713
▷ Static methods21612.61%
▷ Public methods1,25173.03%
▷ Protected methods754.38%
▷ Private methods38722.59%
Functions133
▷ Named functions13198.50%
▷ Anonymous functions21.50%
Constants189
▷ Global constants10756.61%
▷ Class constants8243.39%
▷ Public constants82100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.41MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
Image/layouts/tabs/tab_1.png10.40KB5.85KB▼ 43.79%
Image/wpte-offer.png4.91KB5.00KB0.00%
freemius/assets/img/product-layouts.png52.89KB15.63KB▼ 70.45%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%