83% song-book

Code Review | Song Book

WordPress plugin Song Book scored83%from 54 tests.

About plugin

  • Plugin page: song-book
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: May 24, 2017
  • Latest release: Jul 6, 2023
  • Number of updates: 18
  • Update frequency: every 124.7 days
  • Top authors: JustinTicktock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,367 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.87MB] [CPU: ▲9.73ms] Passed 4 tests

Analyzing server-side resources used by Song Book
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7533.68 ▼4.48
Dashboard /wp-admin4.22 ▲0.9269.62 ▲23.55
Posts /wp-admin/edit.php4.26 ▲0.9065.01 ▲16.46
Add New Post /wp-admin/post-new.php6.81 ▲0.9299.29 ▲5.93
Media Library /wp-admin/upload.php4.17 ▲0.9453.86 ▲21.00
Song Book /wp-admin/options-general.php?page=song-book-settings4.1247.71

Server storage [IO: ▲0.26MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 8 new options
New WordPress options
songbook_install_date
songbook_plugin_version
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Song Book
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,547 ▼19913.15 ▼1.200.50 ▼1.2018.06 ▼22.41
Dashboard /wp-admin2,288 ▲1095.86 ▲0.01106.89 ▲4.7142.76 ▼3.40
Posts /wp-admin/edit.php2,171 ▲822.06 ▲0.0835.75 ▲1.4532.75 ▼6.40
Add New Post /wp-admin/post-new.php1,605 ▲9123.31 ▲5.52667.13 ▲21.2261.26 ▲8.93
Media Library /wp-admin/upload.php1,470 ▲824.21 ▲0.0096.85 ▼6.0242.78 ▼2.35
Song Book /wp-admin/options-general.php?page=song-book-settings8742.0425.2132.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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 did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • songbook_plugin_version
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • songbook_install_date

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/song-book/template/taxonomy-publisher.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/song-book/includes/restrictions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/song-book/template/taxonomy-songwriter.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/song-book/includes/register.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/song-book/template/single-song.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'SONGBOOK' not found in wp-content/plugins/song-book/template/single-songbook-full.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/song-book/includes/class-page-templater.php:153
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/song-book/template/single-songbook.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/song-book/includes/class-songbook-fullcontent.php:81
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/song-book/template/song-search.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === song-book === )
Please take inspiration from this readme.txt

song-book/song-book.php 85% from 13 tests

"Song Book" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,681 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP221,4142,4863,639
CSS213942

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity32.44
▷ Minimum class complexity1.00
▷ Maximum class complexity207.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods169
▷ Static methods127.10%
▷ Public methods14183.43%
▷ Protected methods2313.61%
▷ Private methods52.96%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ 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
No PNG files were detected