10% spotify-play-for-wordpress

Code Review | Plugin Name: Spotify Play Button for WordPress

WordPress plugin Plugin Name: Spotify Play Button for WordPressscored 10% from 54 tests.

About plugin

  • Plugin page: spotify-play-for-...
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.3.1
  • WordPress version: 6.3.1
  • First release: Apr 16, 2012
  • Latest release: Nov 18, 2012
  • Number of updates: 6
  • Update frequency: every 36.3 days
  • Top authors: rhyswynne (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 2,151 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/spotify-play-for-wordpress/spotify-play-for-wordpress.php+251
    Methods with the same name as their class will not be constructors in a future version of PHP; spotify_play_button_for_wordpress_Widget_class has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼54.37ms] Passed 4 tests

This is a short check of server-side resources used by Plugin Name: Spotify Play Button for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.314.65 ▼36.19
Dashboard /wp-admin2.17 ▼1.135.67 ▼44.21
Posts /wp-admin/edit.php2.17 ▼1.186.03 ▼36.94
Add New Post /wp-admin/post-new.php2.17 ▼3.715.82 ▼100.14
Media Library /wp-admin/upload.php2.17 ▼1.065.27 ▼29.63
Spotify Play Button For Wordpress /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions2.177.08

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
widget_spotify_play_button_for_wordpress_widget
widget_recent-comments
spotify-play-button-for-wordpress-link
can_compress_scripts
spotify-play-button-for-wordpress-default
db_upgraded
widget_theysaidso_widget
spotify-play-button-for-wordpress-size
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Plugin Name: Spotify Play Button for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.22 ▼1.081.83 ▼0.0740.22 ▼8.55
Dashboard /wp-admin2,212 ▲475.83 ▲0.81111.91 ▼2.4254.92 ▲13.58
Posts /wp-admin/edit.php2,098 ▲122.05 ▲0.0438.73 ▲0.6533.14 ▲1.34
Add New Post /wp-admin/post-new.php1,537 ▲423.10 ▼0.13645.62 ▼1.98107.42 ▲27.99
Media Library /wp-admin/upload.php1,394 ▲64.23 ▲0.03101.35 ▼11.6945.11 ▼10.22
Spotify Play Button For Wordpress /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions1,2577.91224.78109.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/spotify-play-for-wordpress/spotify-play-for-wordpress.php+251
    Methods with the same name as their class will not be constructors in a future version of PHP; spotify_play_button_for_wordpress_Widget_class has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_spotify_play_button_for_wordpress_widget
    • spotify-play-button-for-wordpress-default
    • spotify-play-button-for-wordpress-link
    • spotify-play-button-for-wordpress-size
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • 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/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > Deprecated in wp-content/plugins/spotify-play-for-wordpress/spotify-play-for-wordpress.php+251
    Methods with the same name as their class will not be constructors in a future version of PHP; spotify_play_button_for_wordpress_Widget_class has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > Warning in wp-content/plugins/spotify-play-for-wordpress/spotify-play-for-wordpress.php+334
    Use of undefined constant spotify_play_button_for_wordpress_Widget - assumed 'spotify_play_button_for_wordpress_Widget' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in spotify_play_button_for_wordpress_Widget_class is deprecated since version 4.3.0! Use __construct() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/spotify-play-for-wordpress/spotify-play-for-wordpress.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > Network (severe)
    http://platform.stumbleupon.com/1/widgets.js - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > Javascript (severe) in unknown
    https://button.buffer.com/button/?id=8ee382ce50212af8&url=http%3A%2F%2Fbloggingdojo.com%2Fwordpress-plugins%2Fspotify-play-button-for-wordpress%2F&text=Just%20been%20using%20Spotify%20Play%20Button%20for%20WordPress%20%23WordPress%20plugin&via=rhyswynne&count=horizontal&placement=button&utm_source=http%3A%2F%2Fwp.com%2Fwp-admin%2Foptions-general.php%3Fpage%3Dspotifyplaybuttonforwordpressoptions&utm_medium=buffer_button&utm_campaign=buffer 15:647 Uncaught TypeError: Cannot set properties of null (setting 'onclick')
    • > GET request to /wp-admin/options-general.php?page=spotifyplaybuttonforwordpressoptions
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === Plugin Name: Spotify Play Button for WordPress=== )
  • Screenshots: Please add images for these screenshots: #1 (The options screen of Spotify Play for Wordpress), #2 (The plugin in the wild!), #3 (The rich text interface that makes editing even easier.)
The official readme.txt might help

spotify-play-for-wordpress/spotify-play-for-wordpress.php Passed 13 tests

The main PHP file in "Plugin Name: Spotify Play Button for WordPress" ver. 0.2.1 adds more information about the plugin and also serves as the entry point for this plugin
95 characters long description:
Easily embed Spotify Tracks & Playlists using the Spotify Play Button into your Wordpress Blog.

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
Success! There were no dangerous files found in this plugin420 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP111722287
CSS1120101
JavaScript16032

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
spotify.png0.83KB0.95KB0.00%