78% connect-to-apple-music

Code Review | Connect to Apple Music

WordPress plugin Connect to Apple Music scored78%from 54 tests.

About plugin

  • Plugin page: connect-to-apple-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.2
  • WordPress version: 6.3.1
  • First release: Feb 25, 2019
  • Latest release: Feb 26, 2019
  • Number of updates: 5
  • Update frequency: every 1.2 days
  • Top authors: alleygrant (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,474 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼0.08ms] 75% from 4 tests

An overview of server-side resources used by Connect to Apple Music
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 808.31ms on /wp-admin/options-general.php?page=apple-music)
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0338.66 ▼1.56
Dashboard /wp-admin3.33 ▲0.0245.91 ▼1.43
Posts /wp-admin/edit.php3.38 ▲0.0249.66 ▲1.79
Add New Post /wp-admin/post-new.php5.91 ▲0.0398.23 ▲2.38
Media Library /wp-admin/upload.php3.25 ▲0.0233.09 ▲0.89
Apple Music /wp-admin/options-general.php?page=apple-music3.26808.31

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 69 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Connect to Apple Music
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.63 ▼0.732.04 ▼0.1242.81 ▼1.14
Dashboard /wp-admin2,213 ▲284.83 ▼0.07111.02 ▲7.3942.94 ▼0.21
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0239.48 ▼2.3935.60 ▼0.88
Add New Post /wp-admin/post-new.php6,225 ▲4,69725.89 ▲7.72907.10 ▲282.2135.77 ▼21.21
Media Library /wp-admin/upload.php1,414 ▲264.33 ▲0.13103.71 ▲1.6142.14 ▼2.98
Apple Music /wp-admin/options-general.php?page=apple-music8082.0328.0525.96

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=apple-music
    • > Notice in wp-content/plugins/connect-to-apple-music/php/class-settings.php+127
    Undefined property: stdClass::$data
    • > GET request to /wp-admin/options-general.php?page=apple-music
    • > Warning in wp-content/plugins/connect-to-apple-music/php/class-settings.php+127
    Invalid argument supplied for foreach()

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 items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Undefined constant 'Apple_Music\\PATH' in wp-content/plugins/connect-to-apple-music/php/includes/includes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Apple_Music\\wp_embed_register_handler() in wp-content/plugins/connect-to-apple-music/php/includes/register-embed-handler.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Apple_Music\\plugin_dir_url() in wp-content/plugins/connect-to-apple-music/connect-to-apple-music.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/connect-to-apple-music/php/includes/types.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: music, apple

connect-to-apple-music/connect-to-apple-music.php 85% from 13 tests

"Connect to Apple Music" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Domain Path: Prefix the domain path with a forward slash character ("/lang/")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("lang/")

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 detected2,917 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript202463051,700
PHP12151263778
CSS1410724431
SVG8008

PHP code Passed 2 tests

An short overview of 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.29
Average class complexity8.67
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods31
▷ Static methods412.90%
▷ Public methods3096.77%
▷ Protected methods13.23%
▷ Private methods00.00%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/images/apple.png1.91KB2.03KB0.00%
dist/images/0fc7d18e01c8c77b8b705cbf4697fb91.png0.30KB0.27KB▼ 7.59%