84% product-gallery-with-quote-button

Code Review | Product Gallery with Quote Button

WordPress plugin Product Gallery with Quote Button scored 84% from 54 tests.

About plugin

  • Plugin page: product-gallery-w...
  • Plugin version: 1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Aug 17, 2022
  • Latest release: Aug 17, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: japsis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.90ms] Passed 4 tests

Analyzing server-side resources used by Product Gallery with Quote Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.35 ▼8.06
Dashboard /wp-admin3.33 ▲0.0346.34 ▼3.89
Posts /wp-admin/edit.php3.38 ▲0.0350.06 ▲1.74
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.24 ▼9.40
Media Library /wp-admin/upload.php3.26 ▲0.0334.61 ▲2.61

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Product Gallery with Quote Button: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.191.77 ▼0.1241.59 ▼2.30
Dashboard /wp-admin2,206 ▲185.87 ▲0.79110.80 ▼2.4840.59 ▼6.43
Posts /wp-admin/edit.php2,092 ▲62.02 ▲0.0340.99 ▲6.0035.30 ▼1.10
Add New Post /wp-admin/post-new.php1,548 ▲1518.17 ▼4.69600.29 ▼62.8368.20 ▲7.33
Media Library /wp-admin/upload.php1,388 ▲34.20 ▼0.0196.82 ▼6.8642.29 ▼5.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_settings_section() in wp-content/plugins/product-gallery-with-quote-button/templates/settings-admin.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'WPGWQB_PLUGIN_DIR/Modules/Gallery/Gallery.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-gallery-with-quote-button/templates/gallery.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ProductGalleryWithQuoteButton\\plugin_basename() in wp-content/plugins/product-gallery-with-quote-button/product-gallery-with-quote-button.php:17
    • > PHP Warning
      Use of undefined constant WPGWQB_PLUGIN_DIR - assumed 'WPGWQB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-gallery-with-quote-button/Modules/Gallery/Gallery.php on line 5
    • > PHP Warning
      Use of undefined constant WPGWQB_PLUGIN_DIR - assumed 'WPGWQB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-gallery-with-quote-button/templates/gallery.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/product-gallery-with-quote-button/templates/contact-form.php:6
    • > PHP Warning
      require_once(WPGWQB_PLUGIN_DIR/Modules/Gallery/Gallery.php): failed to open stream: No such file or directory in wp-content/plugins/product-gallery-with-quote-button/templates/gallery.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'WPGWQB_PLUGIN_DIR/Modules/Product/Product.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-gallery-with-quote-button/Modules/Gallery/Gallery.php on line 5
    • > PHP Warning
      require_once(WPGWQB_PLUGIN_DIR/Modules/Product/Product.php): failed to open stream: No such file or directory in wp-content/plugins/product-gallery-with-quote-button/Modules/Gallery/Gallery.php on line 5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (This screen shot shows the gallery screenshot-1.png. Screenshots are stored in the /assets directory.), #2 (This screen shot shows the gallery with contact form screenshot-2.png.), #3 (This screen shot shows the settings page screenshot-3.png.)
Please take inspiration from this readme.txt

product-gallery-with-quote-button/product-gallery-with-quote-button.php Passed 13 tests

The main PHP script in "Product Gallery with Quote Button" version 1.0 is automatically included on every request by WordPress
70 characters long description:
Create a frontend product gallery and add quote button to each product

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 detected542 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP864128297
CSS1303124
PO File1252665
JavaScript17048
Markdown1308

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity3.75
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.52
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.70MB with 0.43MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png415.54KB108.34KB▼ 73.93%
assets/screenshot-3.png46.07KB25.56KB▼ 44.52%
assets/screenshot-1.png255.24KB86.25KB▼ 66.21%