10% christian-hymns

Code Review | Christian Hymns

WordPress plugin Christian Hymns scored10%from 54 tests.

About plugin

  • Plugin page: christian-hymns
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Mar 24, 2023
  • Number of updates: 319
  • Update frequency: every 5.2 days
  • Top authors: clodoaldoevangelista (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,293 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/christian-hymns/ChristianHymns_Plugin.php+29
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▼1.96MB] [CPU: ▼63.56ms] Passed 4 tests

This is a short check of server-side resources used by Christian Hymns
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.60 ▼43.51
Dashboard /wp-admin2.06 ▼1.285.87 ▼58.76
Posts /wp-admin/edit.php2.06 ▼1.306.96 ▼46.64
Add New Post /wp-admin/post-new.php2.06 ▼3.835.33 ▼105.32
Media Library /wp-admin/upload.php2.06 ▼1.176.44 ▼30.05
Christian Hymns /wp-admin/plugins.php?page=ChristianHymns_PluginSettings2.077.14

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 16 new options
New WordPress options
category_hymns_hp
wp_calendar_block_has_published_posts
can_compress_scripts
ChristianHymns_Plugin_CanDoSomething
theysaidso_admin_options
ChristianHymns_Plugin__installed
ChristianHymns_Plugin_ATextInput
category_hymns_cc
widget_recent-posts
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for Christian Hymns
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲21914.38 ▼0.242.14 ▲0.2944.56 ▲4.04
Dashboard /wp-admin2,219 ▲395.66 ▼0.0286.69 ▼4.8841.12 ▼0.50
Posts /wp-admin/edit.php2,540 ▲4402.04 ▲0.0236.58 ▼4.3834.91 ▼3.25
Add New Post /wp-admin/post-new.php1,545 ▲1423.11 ▼0.18662.53 ▼37.4056.11 ▼0.15
Media Library /wp-admin/upload.php1,409 ▲94.22 ▼0.0498.14 ▼7.2445.75 ▼2.91
Christian Hymns /wp-admin/plugins.php?page=ChristianHymns_PluginSettings9952.0328.5942.27

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
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the style-christian-hymns-a handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 16 options
    • ChristianHymns_Plugin_AmAwesome
    • db_upgraded
    • category_hymns_cc
    • ChristianHymns_Plugin__version
    • ChristianHymns_Plugin_ATextInput
    • ChristianHymns_Plugin__installed
    • widget_theysaidso_widget
    • ChristianHymns_Plugin_CanDoSomething
    • category_hymns_hcc
    • widget_recent-posts
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/plugins.php?page=ChristianHymns_PluginSettings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the style-christian-hymns-a handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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 take a closer look at the following
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/christian-hymns/scripts/install/actives-plugins.php on line 2
    • > PHP Warning
      include_once(CHRISTIAN_HYMNS_DIRChristianHymns_ShortCodeLoader.php): failed to open stream: No such file or directory in wp-content/plugins/christian-hymns/scripts/shortcodes/list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'ChristianHymns_ShortCodeLoader' not found in wp-content/plugins/christian-hymns/scripts/shortcodes/list.php:3
    • > PHP Warning
      include_once(CHRISTIAN_HYMNS_DIRChristianHymns_ShortCodeLoader.php): failed to open stream: No such file or directory in wp-content/plugins/christian-hymns/scripts/shortcodes/player.php on line 2
    • > PHP Warning
      Use of undefined constant CHRISTIAN_HYMNS_DIR - assumed 'CHRISTIAN_HYMNS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/christian-hymns/scripts/shortcodes/player.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/christian-hymns/scripts/install/actives-plugins.php:6
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/christian-hymns/scripts/install/actives-plugins.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'ChristianHymns_ShortCodeLoader' not found in wp-content/plugins/christian-hymns/scripts/shortcodes/player.php:3
    • > PHP Warning
      include_once(): Failed opening 'CHRISTIAN_HYMNS_DIRChristianHymns_ShortCodeLoader.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/christian-hymns/scripts/shortcodes/player.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'CHRISTIAN_HYMNS_DIRChristianHymns_ShortCodeLoader.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/christian-hymns/scripts/shortcodes/list.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
  • Screenshots: Add an image for screenshot #1 (Download the database with the hymns. Baixe o Banco de dados com os hinos.)
You can look at the official readme.txt

christian-hymns/christian-hymns.php Passed 13 tests

The primary PHP file in "Christian Hymns" version 2.2 is used by WordPress to initiate all plugin functionality
87 characters long description:
Several hymns for traditional Christian worship. Learn to sing with letters and Melody.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin877 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP17336626868
CSS1009

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.75
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes225.00%
▷ Concrete classes675.00%
▷ Final classes00.00%
Methods74
▷ Static methods00.00%
▷ Public methods4662.16%
▷ Protected methods2837.84%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ Public constants2100.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
6 PNG files occupy 0.22MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png9.65KB4.13KB▼ 57.20%
images/banner-772x250.png23.09KB8.60KB▼ 62.76%
screenshot-1.png83.00KB38.09KB▼ 54.10%
assets/icon-128x128.png6.13KB2.73KB▼ 55.52%
assets/banner-772x250.png23.09KB8.60KB▼ 62.76%