84% prayer-times-by-aladhan

Code Review | Prayer Times by AlAdhan

WordPress plugin Prayer Times by AlAdhan scored84%from 54 tests.

About plugin

  • Plugin page: prayer-times-by-a...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 14, 2016
  • Latest release: Nov 15, 2016
  • Number of updates: 5
  • Update frequency: every 5.4 days
  • Top authors: madjwi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,017 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.59ms] Passed 4 tests

A check of server-side resources used by Prayer Times by AlAdhan
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.89 ▲1.41
Dashboard /wp-admin3.33 ▲0.0348.56 ▲1.09
Posts /wp-admin/edit.php3.38 ▲0.0346.98 ▲0.59
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.38 ▼7.57
Media Library /wp-admin/upload.php3.25 ▲0.0334.52 ▼0.46

Server storage [IO: ▲1.95MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 264 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_aladhanprayertimeswidget

Browser metrics Passed 4 tests

A check of browser resources used by Prayer Times by AlAdhan
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲12913.73 ▼0.654.80 ▲3.1244.83 ▲3.46
Dashboard /wp-admin2,243 ▲615.01 ▼0.80109.17 ▲7.4139.80 ▼2.55
Posts /wp-admin/edit.php2,128 ▲422.32 ▲0.3237.21 ▲2.1733.85 ▼2.24
Add New Post /wp-admin/post-new.php1,543 ▲623.28 ▼0.00646.43 ▼12.3835.33 ▼25.87
Media Library /wp-admin/upload.php1,428 ▲434.47 ▲0.19100.58 ▲5.7046.36 ▲5.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_aladhanprayertimeswidget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 142× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Event\\AbstractRetryableEvent' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'AlAdhanApi\\Client' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/aladhan/api-client/src/AlAdhanApi/Calendar.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Event\\AbstractTransferEvent' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/prayer-times-by-aladhan/views/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\ExtendedPromiseInterface' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/react/promise/src/LazyPromise.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Stream\\StreamInterface' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/guzzlehttp/streams/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Stream\\StreamInterface' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Event\\SubscriberInterface' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\PromiseInterface' not found in wp-content/plugins/prayer-times-by-aladhan/vendor/react/promise/src/CancellablePromiseInterface.php:5

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: salat times, adhan, azan, namaaz, prayer times

prayer-times-by-aladhan/aladhan.php 92% from 13 tests

"Prayer Times by AlAdhan" version 1.0.0'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:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("prayer-times-by-aladhan.php" instead of "aladhan.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin21,038 lines of code in 249 files:
LanguageFilesBlank linesComment linesLines of code
PHP2143,2694,87417,056
Markdown866902,596
reStructuredText9263333517
JSON500372
make3415172
JavaScript11860163
YAML419083
XML32057
Python14019
CSS1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.53
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces26
Interfaces24
Traits15
Classes172
▷ Abstract classes42.33%
▷ Concrete classes16897.67%
▷ Final classes31.79%
Methods1,458
▷ Static methods896.10%
▷ Public methods1,33891.77%
▷ Protected methods191.30%
▷ Private methods1016.93%
Functions256
▷ Named functions145.47%
▷ Anonymous functions24294.53%
Constants33
▷ Global constants00.00%
▷ Class constants33100.00%
▷ Public constants33100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.99MB with 0.71MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png202.56KB56.29KB▼ 72.21%
assets/screenshot-1.png815.91KB232.91KB▼ 71.45%