84% wp-lazy-spotify

Code Review | WP Lazy Spotify

WordPress plugin WP Lazy Spotify scored84%from 54 tests.

About plugin

  • Plugin page: wp-lazy-spotify
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Feb 3, 2013
  • Latest release: Feb 3, 2013
  • Number of updates: 2
  • Update frequency: every 9.5 days
  • Top authors: TM3909 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,084 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.33MB] [CPU: ▼20.86ms] Passed 4 tests

An overview of server-side resources used by WP Lazy Spotify
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0336.50 ▼3.17
Dashboard /wp-admin3.32 ▼0.0253.68 ▼11.57
Posts /wp-admin/edit.php3.37 ▲0.0252.34 ▲0.43
Add New Post /wp-admin/post-new.php4.61 ▼1.2744.39 ▼66.47
Media Library /wp-admin/upload.php3.24 ▲0.0236.57 ▼2.23

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Lazy Spotify
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15613.46 ▼0.899.32 ▲7.6139.59 ▼3.75
Dashboard /wp-admin2,206 ▲265.73 ▲0.1387.81 ▼2.3441.06 ▼4.97
Posts /wp-admin/edit.php2,108 ▲52.01 ▲0.0137.75 ▼1.9737.36 ▲3.20
Add New Post /wp-admin/post-new.php6,242 ▲4,71318.93 ▼4.12907.59 ▲242.6469.29 ▲2.32
Media Library /wp-admin/upload.php1,411 ▲204.20 ▲0.0296.81 ▼8.3241.25 ▼5.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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)
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-lazy-spotify/wplazyspotify.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: spotify, lazy load

wp-lazy-spotify/wplazyspotify.php 92% from 13 tests

"WP Lazy Spotify" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-lazy-spotify.php" instead of "wplazyspotify.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,681 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript151412861,069
HTML23616314
PHP15227178
Markdown158096
CSS27324

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
spotify-placeholder.png11.60KB4.93KB▼ 57.52%
Socialite/demo/images/social-sprite.png7.18KB3.23KB▼ 54.97%