10% emp-song-selector

Code Review | EMP Song Selector Tool for Mobile DJs

WordPress plugin EMP Song Selector Tool for Mobile DJs scored10%from 54 tests.

About plugin

  • Plugin page: emp-song-selector
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Jun 16, 2015
  • Latest release: Apr 22, 2018
  • Number of updates: 95
  • Update frequency: every 11.0 days
  • Top authors: discosourcedjs (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

10+ active /3,489 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/emp-song-selector/emp-song-selector-free.php+1486
    Undefined variable: new_array

Server metrics [RAM: ▲0.42MB] [CPU: ▲2.90ms] Passed 4 tests

This is a short check of server-side resources used by EMP Song Selector Tool for Mobile DJs
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3640.70 ▼0.69
Dashboard /wp-admin3.74 ▲0.4352.67 ▲1.47
Posts /wp-admin/edit.php3.85 ▲0.5061.09 ▲11.99
Add New Post /wp-admin/post-new.php6.34 ▲0.4595.93 ▲1.42
Media Library /wp-admin/upload.php3.66 ▲0.4347.83 ▲9.41
Manage Songs /wp-admin/edit.php?post_type=songs3.7042.84
Import Songs /wp-admin/edit.php?post_type=songs&page=import-songs3.6338.16
Add New Song /wp-admin/post-new.php?post_type=songs3.7147.34
Add-Ons /wp-admin/edit.php?post_type=songs&page=dsdj-ms-add-ons3.7239.24
Memberships /wp-admin/edit.php?post_type=songs&page=dsdj-ms-memberships3.7236.90
Settings /wp-admin/edit.php?post_type=songs&page=dsdj-ms-settings3.7236.04
Dashboard /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard3.7235.31

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 313 new files
Database: no new tables, 9 new options
New WordPress options
zc_ms_stats
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
zc_ms_settings
theysaidso_admin_options
db_upgraded
zc_ms_version

Browser metrics Passed 4 tests

A check of browser resources used by EMP Song Selector Tool for Mobile DJs
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,061 ▲31513.30 ▼1.292.42 ▲0.5642.97 ▼3.62
Dashboard /wp-admin2,430 ▲2425.18 ▲0.31108.67 ▼4.4962.88 ▲21.91
Posts /wp-admin/edit.php2,399 ▲3072.26 ▲0.2742.17 ▲0.0236.24 ▲2.05
Add New Post /wp-admin/post-new.php1,893 ▲37923.11 ▲5.61595.06 ▼66.1535.61 ▼20.16
Media Library /wp-admin/upload.php1,621 ▲2304.41 ▲0.24103.04 ▲1.0083.55 ▲37.19
Manage Songs /wp-admin/edit.php?post_type=songs1,5012.2634.6632.44
Import Songs /wp-admin/edit.php?post_type=songs&page=import-songs9561.7127.0143.34
Add New Song /wp-admin/post-new.php?post_type=songs1,9273.7577.88104.94
Add-Ons /wp-admin/edit.php?post_type=songs&page=dsdj-ms-add-ons2,4314.1581.4966.80
Memberships /wp-admin/edit.php?post_type=songs&page=dsdj-ms-memberships2,4654.2977.85119.56
Settings /wp-admin/edit.php?post_type=songs&page=dsdj-ms-settings2,4284.1984.3395.19
Dashboard /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard2,4504.1782.02120.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/emp-song-selector/emp-song-selector-free.php+1459
    Array to string conversion
  • Zombie WordPress options detected upon uninstall: 9 options
    • theysaidso_admin_options
    • db_upgraded
    • zc_ms_settings
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • zc_ms_version
    • zc_ms_stats

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=songs
    • > Notice in wp-content/plugins/emp-song-selector/emp-song-selector-free.php+1155
    Trying to get property 'post_type' of non-object
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard
    • > Notice in wp-content/plugins/emp-song-selector/php/settings_ui.php+16
    Undefined index: custom_msg
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/emp-song-selector/emp-song-selector-free.php+248
    Undefined index: post__in
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-add-ons
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/emp-song-selector/emp-song-selector-free.php+693
    Undefined index: seconds
  • 173 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-add-ons
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/emp-song-selector/php/mpdf/classes/otl.php+5636
    Array and string offset access syntax with curly braces is deprecated
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-add-ons
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/emp-song-selector/php/mpdf/mpdf.php+30572
    A non well formed numeric value encountered
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-add-ons
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/emp-song-selector/php/mpdf/mpdf.php+10894
    The each() function is deprecated. This message will be suppressed on further calls

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/emp-song-selector/php/mpdf/compress.php
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emp-song-selector/php/mpdf/graph.php on line 23
    • > PHP Warning
      include_once(): Failed opening '_JPGRAPH_PATHjpgraph_pie.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/emp-song-selector/php/mpdf/graph.php on line 28
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emp-song-selector/php/mpdf/graph.php on line 28
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emp-song-selector/php/mpdf/graph.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_post_type() in wp-content/plugins/emp-song-selector/php/songs-cpt.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_plugin_option() on null in wp-content/plugins/emp-song-selector/php/settings_ui.php:7
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_scatter.php): failed to open stream: No such file or directory in wp-content/plugins/emp-song-selector/php/mpdf/graph.php on line 26
    • > PHP Notice
      Undefined index: dest in wp-content/plugins/emp-song-selector/php/mpdf/includes/out.php on line 12
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emp-song-selector/php/mpdf/graph.php on line 27
    • > PHP Notice
      Undefined index: filename in wp-content/plugins/emp-song-selector/php/mpdf/includes/out.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=songs
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/emp-song-selector/js/library.js?ver=6.3.1:30:51)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function
    • > GET request to /wp-admin/edit.php?post_type=songs&page=import-songs
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/emp-song-selector//js/import.js?ver=6.3.1:4:31)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=songs
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/emp-song-selector/js/library.js?ver=6.3.1:30:51)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=songs
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLInputElement.\u003Canonymous> (/wp-content/plugins/emp-song-selector/js/settings.js?ver=6.3.1:103:15)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:1594)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/emp-song-selector/js/settings.js?ver=6.3.1:102:27)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=songs&page=dsdj-ms-dashboard
    • > Network (severe)
    wp-content/plugins/emp-song-selector-full/images/loading.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

emp-song-selector/emp-song-selector-free.php 92% from 13 tests

The main PHP file in "EMP Song Selector Tool for Mobile DJs" ver. 2.2.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("emp-song-selector.php" instead of "emp-song-selector-free.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin97,344 lines of code in 152 files:
LanguageFilesBlank linesComment linesLines of code
PHP1277,2277,70184,633
CSS10232538,429
SVG2002,959
JavaScript95811521,218
JSON112040
Markdown119033
XML13016
YAML14016

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 8,314)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 1,542)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity560.35
▷ Minimum class complexity1.00
▷ Maximum class complexity8,314.00
Average method complexity21.96
▷ Minimum method complexity1.00
▷ Maximum method complexity1,542.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods828
▷ Static methods708.45%
▷ Public methods80697.34%
▷ Protected methods212.54%
▷ Private methods10.12%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants369
▷ Global constants5915.99%
▷ Class constants31084.01%
▷ Public constants310100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
13 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pdf-icon-small.png0.63KB0.39KB▼ 38.00%
images/close_icon.png3.35KB0.44KB▼ 86.75%
images/header-bg.png0.20KB0.08KB▼ 57.35%
images/emp-logo.png2.38KB1.99KB▼ 16.23%
images/try-me-youtube.png1.58KB1.32KB▼ 16.41%