63% square-thumbnails

Code Review | Square Thumbnails

WordPress plugin Square Thumbnails scored63%from 54 tests.

About plugin

  • Plugin page: square-thumbnails
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Jun 22, 2017
  • Latest release: Oct 15, 2017
  • Number of updates: 11
  • Update frequency: every 10.5 days
  • Top authors: ilmdesigns (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /10,346 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.86MB] [CPU: ▼35.84ms] Passed 4 tests

Analyzing server-side resources used by Square Thumbnails
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1142.45 ▼3.55
Dashboard /wp-admin3.09 ▼0.2625.10 ▼42.48
Posts /wp-admin/edit.php3.09 ▼0.2724.02 ▼22.12
Add New Post /wp-admin/post-new.php3.09 ▼2.8023.86 ▼69.99
Media Library /wp-admin/upload.php3.09 ▼0.1425.90 ▼8.76
Square Thumbnails /wp-admin/upload.php?page=square-thumbnails-admin-page3.0925.46

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Square Thumbnails
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲13813.60 ▼1.137.92 ▲6.1343.75 ▼1.48
Dashboard /wp-admin2,222 ▲455.00 ▼0.5392.69 ▼9.8140.01 ▼3.60
Posts /wp-admin/edit.php2,108 ▲82.51 ▲0.5035.56 ▼0.1531.42 ▼1.14
Add New Post /wp-admin/post-new.php1,551 ▲2523.60 ▲0.50663.94 ▼23.9936.19 ▼15.31
Media Library /wp-admin/upload.php1,431 ▲344.44 ▲0.2398.71 ▼17.6948.27 ▼1.30
Square Thumbnails /wp-admin/upload.php?page=square-thumbnails-admin-page1,0502.5439.4528.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/upload.php?page=square-thumbnails-admin-page
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/square-thumbnails/public/partials/square-thumbnails-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/square-thumbnails/admin/partials/square-thumbnails-admin-display.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
8 plugin tags: creating all sizes, woocommerce, thumbnails, resize, square thumbnails...

square-thumbnails/square-thumbnails.php Passed 13 tests

"Square Thumbnails" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
52 characters long description:
Making Square Thumbnails without cropping the image.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin537 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12186567511
JavaScript285426
CSS2080

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.29
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods39
▷ Static methods25.13%
▷ Public methods2769.23%
▷ Protected methods00.00%
▷ Private methods1230.77%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin