78% sahih-al-bukhari-hadiths

Code Review | Sahih al Bukhari Hadiths

WordPress plugin Sahih al Bukhari Hadiths scored78%from 54 tests.

About plugin

  • Plugin page: sahih-al-bukhari-...
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Aug 13, 2018
  • Latest release: Feb 2, 2022
  • Number of updates: 61
  • Update frequency: every 20.8 days
  • Top authors: karim42 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,880 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.93ms] Passed 4 tests

An overview of server-side resources used by Sahih al Bukhari Hadiths
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0624.93 ▼18.01
Dashboard /wp-admin3.33 ▼0.0256.83 ▼10.67
Posts /wp-admin/edit.php3.38 ▲0.0251.79 ▼1.81
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.48 ▼9.21
Media Library /wp-admin/upload.php3.25 ▲0.0244.21 ▼0.13

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 124 new files
Database: 1 new table, 10 new options
New tables
bukhari_chapters
New WordPress options
widget_recent-posts
theysaidso_admin_options
color_hadith_ref
db_upgraded
background_hadith_ref
can_compress_scripts
widget_theysaidso_widget
background_hadith_bloc
border_hadith_bloc
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sahih al Bukhari Hadiths
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲12313.42 ▼1.158.74 ▲7.0640.86 ▼2.58
Dashboard /wp-admin2,191 ▲145.55 ▼0.1391.09 ▲2.8782.40 ▲40.66
Posts /wp-admin/edit.php2,111 ▲111.99 ▼0.0336.39 ▼2.1437.84 ▼0.67
Add New Post /wp-admin/post-new.php1,689 ▲16321.84 ▼1.38769.93 ▲67.2356.67 ▲4.69
Media Library /wp-admin/upload.php1,408 ▲84.12 ▼0.0998.16 ▼14.5871.70 ▲25.45

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

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 12× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/template/img/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/inc/hadith_style.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/template/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/data/chapters/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/template/js/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/admin/js/jscolor/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/admin/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/admin/js/index.php
    • > /wp-content/plugins/sahih-al-bukhari-hadiths/sahih-al-bukhari-hadiths.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sahih-al-bukhari-hadiths/admin/hadith-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/sahih-al-bukhari-hadiths/template/render_hadith.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Requires php: Version format is invalid
The official readme.txt might help

sahih-al-bukhari-hadiths/sahih-al-bukhari-hadiths.php 92% from 13 tests

The main PHP file in "Sahih al Bukhari Hadiths" ver. 1.2.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 360 characters long)

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
Success! There were no dangerous files found in this plugin81,758 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
HTML9838080,337
JavaScript214438842
PHP816317579

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon_hadith.png1.91KB1.49KB▼ 21.83%
admin/js/jscolor/hs.png2.62KB7.54KB0.00%
admin/js/jscolor/hv.png2.80KB7.32KB0.00%