83% spotify-play-button-for-wordpress

Code Review | Sp*tify Play Button for WordPress

WordPress plugin Sp*tify Play Button for WordPress scored83%from 54 tests.

About plugin

  • Plugin page: spotify-play-butt...
  • Plugin version: 2.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 12, 2012
  • Latest release: Aug 10, 2023
  • Number of updates: 96
  • Update frequency: every 43.1 days
  • Top authors: jonkastonka (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

4,000+ active /67,992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.62ms] Passed 4 tests

Server-side resources used by Sp*tify Play Button for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0437.46 ▲1.62
Dashboard /wp-admin3.35 ▲0.0443.76 ▼5.07
Posts /wp-admin/edit.php3.40 ▲0.0446.87 ▼1.22
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.27 ▼22.23
Media Library /wp-admin/upload.php3.27 ▲0.0433.94 ▼1.95
Sp*tify Play Button settings /wp-admin/options-general.php?page=spotifyplaybutton_settings3.2431.75

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Sp*tify Play Button for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲7314.36 ▲0.091.70 ▼0.1743.65 ▲3.75
Dashboard /wp-admin2,240 ▲635.64 ▲0.0584.09 ▼2.8735.91 ▼8.88
Posts /wp-admin/edit.php2,145 ▲452.00 ▼0.0238.30 ▲3.5237.03 ▼0.35
Add New Post /wp-admin/post-new.php6,240 ▲4,71419.03 ▼4.33864.58 ▲248.7736.41 ▼12.29
Media Library /wp-admin/upload.php1,445 ▲454.23 ▲0.0395.86 ▼0.2641.84 ▼3.46
Sp*tify Play Button settings /wp-admin/options-general.php?page=spotifyplaybutton_settings9042.0225.2328.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/spotify-play-button-for-wordpress/sptify-play-button-for-wordpress.php:13

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: spotify play button, spotify, embed, playlist, spotify play button for wordpress...

spotify-play-button-for-wordpress/sptify-play-button-for-wordpress.php 77% from 13 tests

The principal PHP file in "Sp*tify Play Button for WordPress" v. 2.10 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 182 characters long)
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("spotify-play-button-for-wordpress.php" instead of "sptify-play-button-for-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected400 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP11910210
JavaScript150165
CSS10025

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
sptify-play-button-for-wordpress-icon.png3.56KB1.17KB▼ 67.28%