10% advanced-iranian-widget

Code Review | Advanced Iranian Widget

WordPress plugin Advanced Iranian Widget scored 10% from 54 tests.

About plugin

  • Plugin page: advanced-iranian-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-3.3.1
  • WordPress version: 5.8.1
  • First release: Feb 5, 2012
  • Latest release: Feb 9, 2012
  • Number of updates: 10
  • Update frequency: every 4.1 days
  • Top authors: towhidn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,587 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/advanced-iranian-widget/Advanced-Iranian-Widget.php+31
    Methods with the same name as their class will not be constructors in a future version of PHP; AdvancedIranianWidget has a deprecated constructor

Server metrics [RAM: ▼1.74MB] [CPU: ▼184.74ms] Passed 4 tests

A check of server-side resources used by Advanced Iranian Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.90 ▼0.945.32 ▼16.85
Dashboard /wp-admin1.91 ▼1.154.13 ▼38.96
Posts /wp-admin/edit.php1.92 ▼1.203.65 ▼27.43
Add New Post /wp-admin/post-new.php1.91 ▼3.534.01 ▼651.99
Media Library /wp-admin/upload.php1.91 ▼1.093.14 ▼20.58

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 1 new option
New WordPress options
widget_advancediranianwidget

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Iranian Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,687 ▲8615.92 ▲0.256.10 ▼2.2876.27 ▲0.86
Dashboard /wp-admin2,951 ▲526.09 ▼0.07116.01 ▼14.34167.40 ▼7.21
Posts /wp-admin/edit.php2,761 ▲183.24 ▲0.0162.86 ▼3.45138.38 ▲1.54
Add New Post /wp-admin/post-new.php3,828 ▲8519.42 ▲0.25435.74 ▲5.48163.83 ▼2.00
Media Library /wp-admin/upload.php1,773 ▲245.49 ▼0.06144.76 ▼15.97186.19 ▼12.82

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
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/advanced-iranian-widget/Advanced-Iranian-Widget.php+31
    Methods with the same name as their class will not be constructors in a future version of PHP; AdvancedIranianWidget has a deprecated constructor
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_advancediranianwidget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-iranian-widget/Advanced-Iranian-Widget.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 21 tag instead of maximum 10
The official readme.txt is a good inspiration

advanced-iranian-widget/Advanced-Iranian-Widget.php 85% from 13 tests

The main PHP script in "Advanced Iranian Widget" version 1.1 is automatically included on every request by WordPress
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 207 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-iranian-widget.php" instead of "Advanced-Iranian-Widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin211 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12959154
PO File1212057

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.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 are no PNG files in this plugin