84% thumbnail-crop-position

Code Review | Thumbnail Crop Position

WordPress plugin Thumbnail Crop Position scored84%from 54 tests.

About plugin

  • Plugin page: thumbnail-crop-po...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Jan 10, 2013
  • Latest release: Oct 9, 2013
  • Number of updates: 16
  • Update frequency: every 17.0 days
  • Top authors: javitxu123 (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

3,000+ active /38,310 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.64ms] Passed 4 tests

This is a short check of server-side resources used by Thumbnail Crop Position
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.96 ▼5.57
Dashboard /wp-admin3.35 ▲0.0548.98 ▼1.25
Posts /wp-admin/edit.php3.40 ▲0.0551.77 ▼0.59
Add New Post /wp-admin/post-new.php5.95 ▲0.0696.07 ▼11.16
Media Library /wp-admin/upload.php3.28 ▲0.0538.52 ▲1.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
thumb_crop_position_option

Browser metrics Passed 4 tests

Thumbnail Crop Position: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.22 ▼1.161.56 ▼0.2641.45 ▼4.74
Dashboard /wp-admin2,218 ▲125.76 ▼0.1699.54 ▼7.7240.09 ▼3.95
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0539.74 ▼3.4938.55 ▲0.48
Add New Post /wp-admin/post-new.php1,533 ▲717.70 ▲0.25664.67 ▼2.5265.82 ▲10.04
Media Library /wp-admin/upload.php1,491 ▲914.26 ▲0.0799.53 ▼5.4645.00 ▼1.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/thumbnail-crop-position/thumbnail-crop-position.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: The official readme.txt is a good inspiration

thumbnail-crop-position/thumbnail-crop-position.php 92% from 13 tests

The entry point to "Thumbnail Crop Position" version 1.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin321 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP25652174
CSS23371
PO File2112652
JavaScript25024

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity6.67
▷ Minimum method complexity3.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/arrows.png0.41KB0.47KB0.00%
img/arrows-current.png0.40KB0.49KB0.00%