74% product-gallery

Code Review | Product Gallery

WordPress plugin Product Gallery scored 74% from 54 tests.

About plugin

  • Plugin page: product-gallery
  • Plugin version: 6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.01
  • WordPress version: 6.3.1
  • First release: Dec 30, 2014
  • Latest release: Mar 4, 2015
  • Number of updates: 18
  • Update frequency: every 3.6 days
  • Top authors: hpinfosys (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 4,110 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.37ms] Passed 4 tests

Server-side resources used by Product Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.54 ▼39.94
Dashboard /wp-admin2.05 ▼1.254.48 ▼43.66
Posts /wp-admin/edit.php2.05 ▼1.306.33 ▼39.57
Add New Post /wp-admin/post-new.php2.05 ▼3.835.07 ▼90.32
Media Library /wp-admin/upload.php2.05 ▼1.186.35 ▼26.11

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_widget_rnd_product_view
widget_widget_rnd_category_view
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Product Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲22714.04 ▼0.335.58 ▲3.7237.03 ▼1.88
Dashboard /wp-admin2,244 ▲534.92 ▼0.98111.01 ▲9.3080.99 ▲35.14
Posts /wp-admin/edit.php2,133 ▲442.01 ▼0.0136.81 ▼4.3133.18 ▼3.09
Add New Post /wp-admin/post-new.php1,561 ▲1918.22 ▲0.03678.27 ▲15.4465.86 ▲7.54
Media Library /wp-admin/upload.php1,420 ▲324.26 ▲0.0798.96 ▼4.8475.28 ▲32.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_widget_rnd_category_view
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_widget_rnd_product_view
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-gallery/product-gallery-categories.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-gallery/product-gallery-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/product-gallery/product-gallery.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-gallery/product-gallery-post.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/product-gallery/product-gallery-shortcode.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: image gallery, product gallery, lightbox gallery, category gallery

product-gallery/product-gallery.php Passed 13 tests

"Product Gallery" version 6.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
73 characters long description:
Responsive ( BOOTSTRAP ) Products Gallery view on Footer, Page & Sidebar.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected924 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6132144748
CSS31426142
JavaScript10034

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.00
▷ Minimum class complexity13.00
▷ Maximum class complexity17.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg_play_pause.png1.51KB0.52KB▼ 65.52%
images/previous.png8.46KB4.06KB▼ 51.99%
images/next.png8.58KB4.10KB▼ 52.18%
images/icon.png3.43KB0.87KB▼ 74.77%