62% daily-prayer-time-for-mosques

Code Review | Daily Prayer Time

WordPress plugin Daily Prayer Time scored62%from 54 tests.

About plugin

  • Plugin page: daily-prayer-time...
  • Plugin version: 2023.11.26
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4
  • WordPress version: 6.3.1
  • First release: Aug 4, 2015
  • Latest release: Nov 27, 2023
  • Number of updates: 517
  • Update frequency: every 5.9 days
  • Top authors: mmrs151 (100%)

Code review

54 tests

User reviews

86 reviews

Install metrics

1,000+ active /58,961 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲1.24MB] [CPU: ▲16.99ms] 75% from 4 tests

A check of server-side resources used by Daily Prayer Time
Please fix the following
  • RAM: Try to keep total memory usage under 10MB (currently 16.72MB on /wp-admin/admin.php?page=dpt)
PageMemory (MB)CPU Time (ms)
Home /4.88 ▲1.4266.31 ▲24.02
Dashboard /wp-admin4.58 ▲1.2473.17 ▲6.55
Posts /wp-admin/edit.php4.63 ▲1.2873.78 ▲29.90
Add New Post /wp-admin/post-new.php7.12 ▲1.23104.21 ▲9.96
Media Library /wp-admin/upload.php4.43 ▲1.2058.71 ▲27.44
Helps and Tips /wp-admin/admin.php?page=helps-and-tips4.4253.62
Settings /wp-admin/admin.php?page=dpt16.72408.77

Server storage [IO: ▲8.88MB] [DB: ▲0.84MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 88 new files
Database: 2 new tables, 9 new options
New tables
wp_timetable
wp_timetable_cities
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_dailyprayertime
dpt_dubug
widget_recent-posts
db_upgraded
widget_theysaidso_widget
dpt-init

Browser metrics 75% from 4 tests

A check of browser resources used by Daily Prayer Time
A great user experience is important, so you should focus on the following
  • Nodes: For the best user experience, please reduce the number of DOM nodes under 25,000 (currently 192,093 on /wp-admin/admin.php?page=dpt)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,074 ▲32714.84 ▲0.4812.69 ▲10.9632.16 ▼10.04
Dashboard /wp-admin2,248 ▲705.34 ▼0.40106.47 ▼7.2882.92 ▲37.76
Posts /wp-admin/edit.php2,176 ▲762.47 ▲0.4647.17 ▲9.8737.03 ▲1.43
Add New Post /wp-admin/post-new.php1,585 ▲5923.58 ▲0.30586.84 ▼38.38166.02 ▲106.27
Media Library /wp-admin/upload.php1,469 ▲664.81 ▲0.6197.65 ▲1.3979.53 ▲37.36
Helps and Tips /wp-admin/admin.php?page=helps-and-tips1,1792.4532.4632.33
Settings /wp-admin/admin.php?page=dpt192,0939.80565.46139.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.79MB] 50% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_timetable_cities
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_dailyprayertime
    • dpt_dubug

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/daily-prayer-time-for-mosques/Views/HelpsAndTips.php
  • 56× PHP files trigger server-side errors or warnings when accessed directly (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/daily-prayer-time-for-mosques/Models/db.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-prayer-time-for-mosques/Models/db.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/daily-prayer-time-for-mosques/Models/Processors/DebugProcessor.php:24
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-prayer-time-for-mosques/Models/db.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-prayer-time-for-mosques/Models/db.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/daily-prayer-time-for-mosques/Models/QuranADay/QuranDB.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/daily-prayer-time-for-mosques/Views/Tabs/ThemeSettings.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/daily-prayer-time-for-mosques/Models/db.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/daily-prayer-time-for-mosques/Models/db.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'DailyShortCode' not found in wp-content/plugins/daily-prayer-time-for-mosques/Models/DigitalScreen.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dpt
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-mouse,jquery-ui-draggable,utils,wp-polyfill-inert,regenerator-runtime,wp-pol&load%5Bchunk_1%5D=yfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: \"undefined\" is not valid JSON" "SyntaxError: \"undefined\" is not valid JSON\n at JSON.parse (\u003Canonymous>)\n at Object.fadingMessages (/wp-content/plugins/daily-prayer-time-for-mosques/Assets/js/dpt.js?ver=2023.11.26:382:20)\n at Object.init (/wp-content/plugins/daily-prayer-time-for-mosques/Assets/js/dpt.js?ver=2023.11.26:26:14)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/daily-prayer-time-for-mosques/Assets/js/dpt.js?ver=2023.11.26:398:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-mouse,jquery-ui-draggable,utils,wp-polyfill-inert,regenerator-runtime,wp-pol&load%5Bchunk_1%5D=yfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-mouse,jquery-ui-draggable,utils,wp-polyfill-inert,regenerator-runtime,wp-pol&load%5Bchunk_1%5D=yfill,wp-hooks&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dpt
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-mouse,jquery-ui-draggable,utils,wp-polyfill-inert,regenerator-runtime,wp-pol&load%5Bchunk_1%5D=yfill,wp-hooks&ver=6.3.1 1:28721 Uncaught SyntaxError: "undefined" is not valid JSON

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: Version not formatted correctly
The official readme.txt might help

daily-prayer-time-for-mosques/daily-prayer-time.php 92% from 13 tests

This is the main PHP file of "Daily Prayer Time" version 2023.11.26, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("daily-prayer-time-for-mosques.php" instead of "daily-prayer-time.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin11,086 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP561,3681,2387,341
CSS81931002,922
JavaScript12159156783
YAML10332
HTML1008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.52
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods350
▷ Static methods41.14%
▷ Public methods25472.57%
▷ Protected methods226.29%
▷ Private methods7421.14%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants7
▷ Global constants228.57%
▷ Class constants571.43%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Assets/images/icon.png1.14KB1.03KB▼ 9.87%
Assets/images/icon19.png1.00KB0.95KB▼ 4.80%
Assets/images/print_icon.png2.28KB1.52KB▼ 33.29%