78% prayer-times-anywhere

Code Review | Prayer Times Anywhere

WordPress plugin Prayer Times Anywhere scored78%from 54 tests.

About plugin

  • Plugin page: prayer-times-anyw...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 6.3.1
  • First release: Sep 3, 2015
  • Latest release: May 28, 2018
  • Number of updates: 16
  • Update frequency: every 62.4 days
  • Top authors: mmrs151 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /4,005 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.21ms] Passed 4 tests

An overview of server-side resources used by Prayer Times Anywhere
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0646.43 ▲2.29
Dashboard /wp-admin3.36 ▲0.0155.70 ▼10.30
Posts /wp-admin/edit.php3.47 ▲0.1249.95 ▼7.66
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.39 ▼13.16
Media Library /wp-admin/upload.php3.28 ▲0.0541.14 ▲3.98
Prayer anywhere /wp-admin/options-general.php?page=PrayerAnywhere3.2534.58

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/prayer-times-anywhere/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_prayertimesanywhere

Browser metrics Passed 4 tests

Prayer Times Anywhere: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7514.80 ▲0.371.89 ▲0.2043.75 ▲1.57
Dashboard /wp-admin2,224 ▲185.85 ▲0.97108.84 ▲6.0243.33 ▲3.49
Posts /wp-admin/edit.php2,103 ▼02.06 ▲0.0735.81 ▼8.0833.83 ▼4.60
Add New Post /wp-admin/post-new.php1,545 ▲1323.29 ▲0.11679.11 ▲24.3168.49 ▲8.53
Media Library /wp-admin/upload.php1,409 ▲94.26 ▲0.00103.01 ▼1.4246.83 ▼5.19
Prayer anywhere /wp-admin/options-general.php?page=PrayerAnywhere1,0042.0222.5933.97

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_prayertimesanywhere
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=PrayerAnywhere
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/prayer-times-anywhere/Views/WidgetForm.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/prayer-times-anywhere/Views/PrayerTimePrinter.php:98
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/prayer-times-anywhere/PTAWidget.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/prayer-times-anywhere/Models/WidgetProcessing.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: prayer time, islam, timetable, salah time, namaz

prayer-times-anywhere/PTAWidget.php 92% from 13 tests

The entry point to "Prayer Times Anywhere" version 2.0.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("prayer-times-anywhere.php" instead of "PTAWidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin551 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP56581428
CSS164123

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1365.00%
▷ Protected methods15.00%
▷ Private methods630.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin