89% gn-product-and-image-remover

Code Review | GN Product and Image Remover

WordPress plugin GN Product and Image Remover scored89%from 54 tests.

About plugin

  • Plugin page: gn-product-and-im...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 26, 2023
  • Latest release: Sep 26, 2023
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: orionaselite (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /73 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.65ms] Passed 4 tests

This is a short check of server-side resources used by GN Product and Image Remover
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.56 ▼2.33
Dashboard /wp-admin3.31 ▲0.0053.84 ▲1.68
Posts /wp-admin/edit.php3.36 ▲0.0052.05 ▲1.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.03 ▼3.41
Media Library /wp-admin/upload.php3.23 ▲0.0042.28 ▲2.38

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for GN Product and Image Remover
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.45 ▲0.021.88 ▼0.1942.21 ▼1.73
Dashboard /wp-admin2,224 ▲214.83 ▼0.05120.36 ▲12.3239.23 ▼5.78
Posts /wp-admin/edit.php2,100 ▼32.05 ▲0.0037.67 ▼0.5432.14 ▼7.14
Add New Post /wp-admin/post-new.php1,548 ▲323.31 ▲2.11670.42 ▼66.7960.30 ▼8.60
Media Library /wp-admin/upload.php1,397 ▼64.22 ▼0.08125.04 ▲18.5949.15 ▲0.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Requires php: Invalid version format
  • Requires at least: Invalid version format
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

gn-product-and-image-remover/gn-product-and-image-remover.php Passed 13 tests

Analyzing the main PHP file in "GN Product and Image Remover" version 1.0.0
106 characters long description:
Allows you to delete Woocommerce images after deleting product unless the image is used in another product

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected147 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP670327147
CSS1030
JavaScript12150

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods12
▷ Static methods18.33%
▷ Public methods975.00%
▷ Protected methods00.00%
▷ Private methods325.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
No PNG files were detected