72% woolayout

Code Review | WooLayout

WordPress plugin WooLayout scored72%from 54 tests.

About plugin

  • Plugin page: woolayout
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7
  • WordPress version: 6.3.1
  • First release: Apr 13, 2017
  • Latest release: May 9, 2017
  • Number of updates: 10
  • Update frequency: every 3.1 days
  • Top authors: buboiasinine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,703 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.96MB] [CPU: ▲17.89ms] Passed 4 tests

Analyzing server-side resources used by WooLayout
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.40 ▲0.9456.98 ▲15.13
Dashboard /wp-admin4.33 ▲1.0276.99 ▲24.20
Posts /wp-admin/edit.php4.38 ▲1.0282.24 ▲33.08
Add New Post /wp-admin/post-new.php6.83 ▲0.95104.20 ▲4.49
Media Library /wp-admin/upload.php4.17 ▲0.9466.01 ▲27.73
Shop Page /wp-admin/admin.php?page=woolayout-shop-page4.1354.19
Product Page /wp-admin/admin.php?page=woolayout-product-page4.1351.27
WooLayOut /wp-admin/admin.php?page=woolayout-menu-page4.1562.09

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooLayout
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,126 ▲35516.50 ▲2.356.79 ▲4.9948.42 ▲6.94
Dashboard /wp-admin2,416 ▲2257.30 ▲2.23155.57 ▲48.7743.45 ▼4.72
Posts /wp-admin/edit.php2,328 ▲2393.94 ▲1.9461.08 ▲23.2532.03 ▼2.80
Add New Post /wp-admin/post-new.php1,595 ▲6722.82 ▲4.46682.62 ▲29.2638.64 ▼12.00
Media Library /wp-admin/upload.php1,466 ▲785.11 ▲0.9491.72 ▼12.4845.51 ▼1.15
Shop Page /wp-admin/admin.php?page=woolayout-shop-page5,6785.22195.8180.02
Product Page /wp-admin/admin.php?page=woolayout-product-page7,0377.55276.6892.79
WooLayOut /wp-admin/admin.php?page=woolayout-menu-page1,0263.5652.0674.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 68 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+244
    Undefined variable: sections
  • 102 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+244
    Undefined variable: sections_settings
  • 177 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+400
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=woolayout-shop-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/shop.php+275
    Undefined variable: column_settings_free
  • 62 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+400
    Undefined variable: column
  • 74 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+400
    Undefined variable: column_settings
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1276
    Undefined index: border-radius
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1298
    Undefined index: id
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1250
    Undefined index: border-width
  • 32 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1263
    Undefined index: border-style
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1269
    Undefined index: border-color
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1429
    Undefined index: class
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1495
    Undefined index: padding
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1496
    Undefined index: margin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woolayout-product-page
    • > Notice in wp-content/plugins/woolayout/lib/function/setting-pages/product.php+1149
    Undefined index: css

SRP 0% 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 take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woolayout/lib/woolayout/loop/loop-start.php
    • > /wp-content/plugins/woolayout/lib/woolayout/loop/loop-end.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woolayout/lib/woolayout/single-product/loop.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woolayout/lib/woolayout/single-product/feat-images.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woolayout/lib/function/drag-and-drop-save.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woolayout/lib/woolayout/single-product/add-to-cart.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woolayout/lib/function/menu.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woolayout/lib/function/default-setup/default-product-page.php:251
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woolayout/lib/function/menu.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woolayout/lib/function/menu.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woolayout/lib/function/woolayout-shortcode.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woolayout/lib/function/default-setup/default-shop-page.php:2

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 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • License uri: Invalid URI ("GPLv2 or later")
You can look at the official readme.txt

woolayout/woocommerce-layout.php 92% from 13 tests

"WooLayout" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woolayout.php" instead of "woocommerce-layout.php")

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
Everything looks great! No dangerous files found in this plugin14,687 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,1552,1357,432
PHP562,1018886,509
CSS318258746

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions58
▷ Named functions5696.55%
▷ Anonymous functions23.45%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/function/setting-pages/images/sale3.png3.57KB1.87KB▼ 47.72%
lib/function/setting-pages/images/sale1.png3.52KB2.07KB▼ 41.29%
lib/function/setting-pages/images/gallery1.png9.67KB6.67KB▼ 31.00%
lib/function/setting-pages/images/sale2.png2.56KB0.88KB▼ 65.51%
controls.png2.19KB0.95KB▼ 56.49%