78% ahadis-imam-ali

Code Review | Ahadis Imam Ali

WordPress plugin Ahadis Imam Ali scored 78% from 54 tests.

About plugin

  • Plugin page: ahadis-imam-ali
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 6.3.1
  • First release: Mar 24, 2021
  • Latest release: Mar 24, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mparsa1372 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 442 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Ahadis Imam Ali
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.39 ▼8.83
Dashboard /wp-admin3.32 ▲0.0144.13 ▼2.90
Posts /wp-admin/edit.php3.37 ▲0.0148.03 ▼0.20
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.37 ▼12.26
Media Library /wp-admin/upload.php3.24 ▲0.0134.31 ▲2.66

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Ahadis Imam Ali: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9914.45 ▲0.071.97 ▼0.1042.55 ▼0.73
Dashboard /wp-admin2,222 ▲375.83 ▼0.0596.87 ▼6.3042.33 ▼1.97
Posts /wp-admin/edit.php2,108 ▲192.01 ▼0.0539.06 ▲0.7440.94 ▲1.31
Add New Post /wp-admin/post-new.php1,546 ▲1323.18 ▼0.10642.37 ▲29.4651.43 ▲1.25
Media Library /wp-admin/upload.php1,398 ▲74.17 ▼0.0295.12 ▼3.7943.67 ▲0.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ahadis-imam-ali/includes/admin/help.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant URLIMAMALI - assumed 'URLIMAMALI' (this will throw an Error in a future version of PHP) in wp-content/plugins/ahadis-imam-ali/includes/admin/help.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ahadis-imam-ali/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ahadis-imam-ali/includes/admin/menu.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ahadis-imam-ali/includes/public/ahadis.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ahadis-imam-ali/imamali.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: imamali, hadis

ahadis-imam-ali/imamali.php 85% from 13 tests

The main PHP file in "Ahadis Imam Ali" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 416 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("ahadis-imam-ali.php" instead of "imamali.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 plugin142 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5112867
JavaScript13062
CSS11011
Markdown1102

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/admin/img/Imam-ali.png121.90KB45.85KB▼ 62.39%