84% product-screenshot

Code Review | Product Screenshot

WordPress plugin Product Screenshot scored84%from 54 tests.

About plugin

  • Plugin page: product-screenshot
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 21, 2021
  • Latest release: Aug 3, 2023
  • Number of updates: 9
  • Update frequency: every 72.6 days
  • Top authors: hasthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /494 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.26MB] [CPU: ▼4.40ms] 75% from 4 tests

A check of server-side resources used by Product Screenshot
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,576.15ms on /wp-admin/edit.php?post_type=prscrt&page=productscreen-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3137.35 ▼5.75
Dashboard /wp-admin3.59 ▲0.2948.90 ▼3.12
Posts /wp-admin/edit.php3.64 ▲0.2949.74 ▼6.95
Add New Post /wp-admin/post-new.php6.13 ▲0.2585.77 ▼1.79
Media Library /wp-admin/upload.php3.45 ▲0.2339.87 ▲7.57
Recommendations /wp-admin/edit.php?post_type=prscrt&page=productscreen-recommendations7.901,576.15
Add New /wp-admin/post-new.php?post_type=prscrt3.8050.29
Settings /wp-admin/edit.php?post_type=prscrt&page=prscrt_options3.6539.87
All Product Screenshot /wp-admin/edit.php?post_type=prscrt3.7943.98

Server storage [IO: ▲1.79MB] [DB: ▲0.67MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Product Screenshot
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲12413.63 ▼0.744.36 ▲2.5043.44 ▼1.19
Dashboard /wp-admin2,254 ▲695.86 ▼0.0399.45 ▼2.5839.97 ▼0.93
Posts /wp-admin/edit.php2,145 ▲532.09 ▲0.0437.11 ▼5.3833.34 ▼3.93
Add New Post /wp-admin/post-new.php1,553 ▲1122.86 ▲4.54670.35 ▲57.8655.31 ▼0.78
Media Library /wp-admin/upload.php1,447 ▲624.27 ▲0.0995.26 ▼0.8040.67 ▼2.21
Recommendations /wp-admin/edit.php?post_type=prscrt&page=productscreen-recommendations3,2633.8758.6899.74
Add New /wp-admin/post-new.php?post_type=prscrt2,0025.0774.5243.38
Settings /wp-admin/edit.php?post_type=prscrt&page=prscrt_options7,1866.02248.2745.75
All Product Screenshot /wp-admin/edit.php?post_type=prscrt1,4533.8760.8527.96

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • prscrt_option_fields
    • theysaidso_admin_options

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
Even though everything seems fine, this is not an exhaustive test

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'ProductScreenshoot\\Admin\\Recommended_Plugins' not found in wp-content/plugins/product-screenshot/admin/class-recommendation-plugins.php:37

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: gallery, product preview, popup, shortcode, screenshot

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

This is the main PHP file of "Product Screenshot" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
26 characters long description:
Product Screenshot Gallery

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin34,794 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP923,5111,63715,330
PO File203,0373,4146,180
Sass1595934,837
CSS72925064,236
JavaScript91,3094024,162
SVG30049

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity24.99
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity6.83
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes68
▷ Abstract classes22.94%
▷ Concrete classes6697.06%
▷ Final classes11.52%
Methods280
▷ Static methods4516.07%
▷ Public methods27899.29%
▷ Protected methods00.00%
▷ Private methods20.71%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/images/extensions/cf7-extensions-pro.png8.57KB0.00KB▼ 100.00%
assets/images/extensions/multicurrencypro.png19.01KB9.36KB▼ 50.77%
assets/images/extensions/swatchly-pro.png13.99KB5.41KB▼ 61.37%
assets/images/extensions/woolentor-addons-pro.png3.20KB1.69KB▼ 47.09%
assets/images/extensions/htmega-pro.png4.60KB4.78KB0.00%