83% spotify-follow-button-widget

Code Review | Spotify Follow Widget

WordPress plugin Spotify Follow Widget scored 83% from 53 tests.

About plugin

  • Plugin page: spotify-follow-bu...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 5.8.1
  • First release: Jan 11, 2014
  • Latest release: Jan 11, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: drsounds (100%)

Code review

53 tests

User reviews

1 review

Install metrics

100+ active / 1,649 total downloads

Benchmarks

Plugin footprint 83% 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.02MB] [CPU: ▼260.97ms] Passed 4 tests

An overview of server-side resources used by Spotify Follow Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1444.83 ▲24.09
Dashboard /wp-admin3.08 ▲0.0341.84 ▼5.54
Posts /wp-admin/edit.php3.13 ▲0.0345.97 ▲3.30
Add New Post /wp-admin/post-new.php5.45 ▲0.0297.57 ▼1,031.42
Media Library /wp-admin/upload.php3.02 ▲0.0233.03 ▼10.21

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 1 new option
New WordPress options
widget_ac_spotify_follow_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Spotify Follow Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,673 ▲6715.98 ▲0.3910.04 ▲0.7748.52 ▲0.42
Dashboard /wp-admin2,930 ▲805.94 ▲0.11142.77 ▲5.42108.02 ▲1.40
Posts /wp-admin/edit.php2,703 ▼32.70 ▲0.0268.61 ▲0.7098.76 ▼1.17
Add New Post /wp-admin/post-new.php1,853 ▲27619.20 ▲2.33406.82 ▲3.47116.07 ▼9.02
Media Library /wp-admin/upload.php1,772 ▼04.99 ▼0.01169.13 ▲7.33117.86 ▼1.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_ac_spotify_follow_widget

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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/spotify-follow-button-widget/spotify-follow.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === spotify-follow-button-widget === )
The official readme.txt is a good inspiration

spotify-follow-button-widget/spotify-follow.php 85% from 13 tests

The principal PHP file in "Spotify Follow Widget" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("spotify-follow-button-widget.php" instead of "spotify-follow.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected74 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1173474

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin