89% svg-autocrop

Code Review | SVG Autocrop

WordPress plugin SVG Autocrop scored89%from 54 tests.

About plugin

  • Plugin page: svg-autocrop
  • Plugin version: 0.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 13, 2020
  • Latest release: May 13, 2023
  • Number of updates: 6
  • Update frequency: every 197.7 days
  • Top authors: cjyabraham (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /8,568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

A check of server-side resources used by SVG Autocrop
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.40 ▼2.82
Dashboard /wp-admin3.31 ▲0.0047.03 ▼2.21
Posts /wp-admin/edit.php3.36 ▲0.0050.05 ▲2.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.73 ▼4.41
Media Library /wp-admin/upload.php3.23 ▲0.0036.11 ▲2.22

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by SVG Autocrop
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.601.69 ▼0.2237.92 ▼12.87
Dashboard /wp-admin2,206 ▲155.86 ▲0.97108.07 ▲2.4842.19 ▼3.03
Posts /wp-admin/edit.php2,092 ▼02.01 ▼0.0539.61 ▲0.3636.12 ▼2.52
Add New Post /wp-admin/post-new.php1,542 ▲2818.43 ▲0.63593.30 ▼93.3371.85 ▲15.77
Media Library /wp-admin/upload.php1,382 ▼64.19 ▼0.0396.71 ▲0.6941.68 ▼6.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: svg

svg-autocrop/wp-svg-autocrop.php 77% from 13 tests

The principal PHP file in "SVG Autocrop" v. 0.1.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("svg-autocrop.php" instead of "wp-svg-autocrop.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin516 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP11119251492
Markdown111013
JSON20011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.50
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods3085.71%
▷ Protected methods25.71%
▷ Private methods38.57%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin