84% sort-my-sites

Code Review | Sort My Sites

WordPress plugin Sort My Sites scored 84% from 54 tests.

About plugin

  • Plugin page: sort-my-sites
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 3, 2015
  • Latest release: Feb 10, 2023
  • Number of updates: 21
  • Update frequency: every 138.1 days
  • Top authors: tryon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 3,724 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.21ms] Passed 4 tests

This is a short check of server-side resources used by Sort My Sites
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.66 ▼2.80
Dashboard /wp-admin3.32 ▲0.0247.54 ▼4.86
Posts /wp-admin/edit.php3.37 ▲0.0243.58 ▼1.11
Add New Post /wp-admin/post-new.php5.90 ▲0.0292.80 ▼2.80
Media Library /wp-admin/upload.php3.25 ▲0.0232.53 ▼2.37

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sort My Sites
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.33 ▼1.051.68 ▼0.0841.46 ▼3.47
Dashboard /wp-admin2,209 ▲215.86 ▲0.93102.54 ▼14.6939.27 ▼8.02
Posts /wp-admin/edit.php2,089 ▲32.01 ▼0.0036.63 ▲0.4833.74 ▲0.71
Add New Post /wp-admin/post-new.php1,540 ▲1223.38 ▲0.33629.37 ▲8.1350.30 ▼5.33
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.0395.75 ▼0.3241.82 ▲0.61

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sort-my-sites/admin/views/settings-network.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === sort-my-sites === )
  • Screenshots: Screenshot #1 (/options-screenshot.png) image required
The official readme.txt is a good inspiration

sort-my-sites/sort-my-sites.php Passed 13 tests

The principal PHP file in "Sort My Sites" v. 1.3 is loaded by WordPress automatically on each request
77 characters long description:
Sort both the Admin Bar->My Sites dropdown and My Sites page in the dasboard.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin248 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP36631243
Markdown1305

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity18.00
▷ Minimum class complexity9.00
▷ Maximum class complexity27.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods215.38%
▷ Public methods1184.62%
▷ Protected methods00.00%
▷ Private methods215.38%
Functions0
▷ Named functions00.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
options-screenshot.png6.09KB6.28KB0.00%