10% banner-generator-for-woocommerce

Code Review | Banner Generator For Woocommerce

WordPress plugin Banner Generator For Woocommerce scored10%from 54 tests.

About plugin

  • Plugin page: banner-generator-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: Nov 21, 2016
  • Latest release: Nov 24, 2016
  • Number of updates: 13
  • Update frequency: every 0.2 days
  • Top authors: patrycjuszm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,358 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/banner-generator-for-woocommerce/const.php+130
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.87MB] [CPU: ▼53.53ms] Passed 4 tests

A check of server-side resources used by Banner Generator For Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.356.47 ▼34.69
Dashboard /wp-admin2.14 ▼1.176.46 ▼40.83
Posts /wp-admin/edit.php2.14 ▼1.226.36 ▼44.31
Add New Post /wp-admin/post-new.php2.14 ▼3.758.11 ▼94.27
Media Library /wp-admin/upload.php2.14 ▼1.096.83 ▼29.47

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 155 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
wbg_opts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Banner Generator For Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.15 ▼0.401.64 ▲0.1040.71 ▼3.15
Dashboard /wp-admin2,228 ▲485.74 ▲0.08104.61 ▲12.6343.36 ▲3.78
Posts /wp-admin/edit.php2,130 ▲302.67 ▲0.6947.05 ▲11.5137.49 ▲0.36
Add New Post /wp-admin/post-new.php1,549 ▲2323.70 ▲0.14687.67 ▲22.3739.63 ▼11.42
Media Library /wp-admin/upload.php1,433 ▲365.26 ▲1.06106.09 ▲2.4844.59 ▲1.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/banner-generator-for-woocommerce/const.php+130
    define(): Declaration of case-insensitive constants is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • wbg_opts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 24× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/banner-generator-for-woocommerce/templates/adminTabContent1.php:10
    • > PHP Fatal error
      Uncaught Error: Call to a member function getGifSrc() on null in wp-content/plugins/banner-generator-for-woocommerce/templates/adminGifGenerate.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/banner-generator-for-woocommerce/config/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/banner-generator-for-woocommerce/templates/adminTabContent3.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/banner-generator-for-woocommerce/const.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/banner-generator-for-woocommerce/includes/admin/wbgAdmin.class.php:99
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/banner-generator-for-woocommerce/effects/wooGrid/templates/wbgWooGridEffectAdmin.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'wbgAdmin' not found in wp-content/plugins/banner-generator-for-woocommerce/templates/adminProjectsPagination.php:13
    • > PHP Notice
      Undefined variable: project in wp-content/plugins/banner-generator-for-woocommerce/templates/adminGifGenerate.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/banner-generator-for-woocommerce/templates/adminTabContent4.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: animated, products, gif, woocommerce, banner

banner-generator-for-woocommerce/banner-generator-for-woocommerce.php 92% from 13 tests

"Banner Generator For Woocommerce" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected30,031 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript45,1533,93620,690
PHP339982,4244,607
CSS71351252,612
SVG2001,601
HTML19616447
JSON10074

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity26.46
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods411
▷ Static methods338.03%
▷ Public methods31476.40%
▷ Protected methods00.00%
▷ Private methods9723.60%
Functions42
▷ Named functions2661.90%
▷ Anonymous functions1638.10%
Constants111
▷ Global constants6457.66%
▷ Class constants4742.34%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.43MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/help9.png92.61KB50.92KB▼ 45.02%
assets/images/help2.png15.91KB8.24KB▼ 48.25%
assets/images/help5.png12.29KB6.48KB▼ 47.31%
assets/images/help10.png139.13KB75.75KB▼ 45.55%
assets/plugins/jquery-ui-1.12.1.custom/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%