10% daily-hadith-widget

Code Review | Daily Hadith Widget

WordPress plugin Daily Hadith Widget scored10%from 54 tests.

About plugin

  • Plugin page: daily-hadith-widget
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.5
  • WordPress version: 6.3.1
  • First release: Dec 7, 2017
  • Latest release: Oct 27, 2020
  • Number of updates: 26
  • Update frequency: every 40.6 days
  • Top authors: nath4n (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,363 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/daily-hadith-widget/init.php+20
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_daily_hadith_widget has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼56.60ms] Passed 4 tests

An overview of server-side resources used by Daily Hadith Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.395.16 ▼38.95
Dashboard /wp-admin2.10 ▼1.216.51 ▼48.29
Posts /wp-admin/edit.php2.10 ▼1.265.71 ▼43.74
Add New Post /wp-admin/post-new.php2.10 ▼3.795.80 ▼95.40
Media Library /wp-admin/upload.php2.10 ▼1.146.37 ▼35.58

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_wp_daily_hadith_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Daily Hadith Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲14913.58 ▼1.0211.22 ▲9.5759.15 ▲12.20
Dashboard /wp-admin2,195 ▲185.59 ▼0.0199.30 ▼3.2741.51 ▼4.53
Posts /wp-admin/edit.php2,097 ▼61.94 ▲0.0039.76 ▼0.5438.51 ▲1.57
Add New Post /wp-admin/post-new.php1,531 ▲322.99 ▼0.23632.19 ▼89.5354.27 ▼2.32
Media Library /wp-admin/upload.php1,400 ▼04.10 ▼0.03104.48 ▼9.8448.47 ▼4.51

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 cannot be uninstalled
    • > Deprecated in wp-content/plugins/daily-hadith-widget/init.php+20
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_daily_hadith_widget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_wp_daily_hadith_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/daily-hadith-widget/init.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: islam, widget, hadith, daily hadith, hadist...

daily-hadith-widget/init.php 92% from 13 tests

The main file in "Daily Hadith Widget" v. 3.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("daily-hadith-widget.php" instead of "init.php")

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
No dangerous file extensions were detected85 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1111985

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin