84% my-sites-widget

Code Review | My Sites Widget

WordPress plugin My Sites Widget scored84%from 54 tests.

About plugin

  • Plugin page: my-sites-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Aug 10, 2011
  • Latest release: Jan 4, 2014
  • Number of updates: 7
  • Update frequency: every 125.4 days
  • Top authors: scribu (85.71%)m_uysl (28.57%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,281 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.66ms] Passed 4 tests

Server-side resources used by My Sites Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.34 ▼2.12
Dashboard /wp-admin3.32 ▼0.0244.20 ▼12.58
Posts /wp-admin/edit.php3.37 ▲0.0242.25 ▼0.37
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.10 ▼15.55
Media Library /wp-admin/upload.php3.24 ▲0.0232.91 ▲0.36

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_other_sites
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by My Sites Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.34 ▼1.041.58 ▼0.2138.37 ▼6.10
Dashboard /wp-admin2,203 ▲155.78 ▲0.88100.15 ▼9.7138.86 ▼3.46
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0134.59 ▼3.7532.31 ▼2.07
Add New Post /wp-admin/post-new.php1,534 ▲623.13 ▲4.94673.60 ▲65.6753.47 ▼5.81
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.0492.77 ▼6.9942.89 ▼4.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_other_sites
    • theysaidso_admin_options
    • widget_theysaidso_widget

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 no errors were found, 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/my-sites-widget/my-sites-widget.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Screenshot #1 (screenshot-1.png) image required
Please take inspiration from this readme.txt

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

Analyzing the main PHP file in "My Sites Widget" version 1.0
75 characters long description:
A widget that displays a list of sites that the current user has access to.

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
Success! There were no dangerous files found in this plugin47 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1211847

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.10MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png102.38KB2.87KB▼ 97.20%