10% lastfm-top-artists

Code Review | LastFM Top Artists

WordPress plugin LastFM Top Artists scored 10% from 54 tests.

About plugin

  • Plugin page: lastfm-top-artists
  • Plugin version: 0.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.6.1
  • WordPress version: 5.8.1
  • First release: Aug 30, 2012
  • Latest release: Oct 17, 2016
  • Number of updates: 23
  • Update frequency: every 65.6 days
  • Top authors: alairock (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,750 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/lastfm-top-artists/lastfm.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; LastFMTopArtistsWidget has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼193.34ms] Passed 4 tests

A check of server-side resources used by LastFM Top Artists
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼0.926.25 ▼14.89
Dashboard /wp-admin1.82 ▼1.245.41 ▼40.14
Posts /wp-admin/edit.php1.82 ▼1.295.72 ▼40.87
Add New Post /wp-admin/post-new.php1.82 ▼3.615.55 ▼657.50
Media Library /wp-admin/upload.php1.82 ▼1.195.20 ▼34.84

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 1 new option
New WordPress options
widget_lastfmtopartistswidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for LastFM Top Artists
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.83 ▲0.289.74 ▼0.6748.09 ▲3.56
Dashboard /wp-admin2,967 ▲335.94 ▼0.15141.90 ▼3.71113.21 ▲7.72
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0168.54 ▼14.2287.74 ▼1.36
Add New Post /wp-admin/post-new.php1,672 ▼018.86 ▲0.00388.82 ▼26.43104.04 ▼6.22
Media Library /wp-admin/upload.php1,807 ▼35.03 ▼0.00149.57 ▼5.94113.62 ▲0.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/lastfm-top-artists/lastfm.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; LastFMTopArtistsWidget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_lastfmtopartistswidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/lastfm-top-artists/lastfm.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Shot of the plugin widget in action!), #2 (Admin settings)
The official readme.txt is a good inspiration

lastfm-top-artists/lastfm.php 92% from 13 tests

The entry point to "LastFM Top Artists" version 0.5.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("lastfm-top-artists.php" instead of "lastfm.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
Good job! No executable or dangerous file extensions detected74 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1151174

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png19.24KB5.99KB▼ 68.86%
screenshot-1.png23.44KB6.93KB▼ 70.42%