58% iran-agency-map

Code Review | Iran agency map

WordPress plugin Iran agency map scored58%from 54 tests.

About plugin

  • Plugin page: iran-agency-map
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2
  • WordPress version: 6.3.1
  • First release: Apr 30, 2019
  • Latest release: May 17, 2019
  • Number of updates: 6
  • Update frequency: every 2.8 days
  • Top authors: hossein52hz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,526 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▲2.57ms] Passed 4 tests

An overview of server-side resources used by Iran agency map
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1948.39 ▲1.28
Dashboard /wp-admin3.52 ▲0.2154.51 ▲6.24
Posts /wp-admin/edit.php3.63 ▲0.2757.10 ▲8.44
Add New Post /wp-admin/post-new.php6.10 ▲0.2186.06 ▼1.17
Media Library /wp-admin/upload.php3.42 ▲0.1937.66 ▲3.91
Settings /wp-admin/admin.php?page=agencies_setting3.4238.43
agencies /wp-admin/admin.php?page=agencies3.4240.19
Add new /wp-admin/admin.php?page=agencies_form3.3929.87

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: 2 new tables, 7 new options
New tables
wp_iam_province_info
wp_iam_agencies_info
New WordPress options
iran_agency_map_db_version
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Iran agency map
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲33215.66 ▲1.039.40 ▲7.6238.69 ▼5.29
Dashboard /wp-admin2,392 ▲2076.65 ▲0.75134.01 ▲20.7137.97 ▼8.51
Posts /wp-admin/edit.php2,307 ▲2183.54 ▲1.5858.65 ▲23.8034.50 ▼0.70
Add New Post /wp-admin/post-new.php1,559 ▲4523.23 ▲5.76661.79 ▼30.3638.04 ▼18.12
Media Library /wp-admin/upload.php1,444 ▲564.34 ▲0.1282.34 ▼16.9839.95 ▼4.81
Settings /wp-admin/admin.php?page=agencies_setting1,2643.5960.3543.59
agencies /wp-admin/admin.php?page=agencies1,3013.3839.0927.33
Add new /wp-admin/admin.php?page=agencies_form1,3683.3741.8829.28

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/iran-agency-map/includes/uninstall.php+10
    Undefined variable: wpdb
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_iam_agencies_info
    • wp_iam_province_info
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=agencies_form
    • > Notice in wp-content/plugins/iran-agency-map/admin/new-edit-form-handler.php+105
    Undefined variable: item_id

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
Please fix the following
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/iran-agency-map/includes/scripts.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/iran-agency-map/admin/iam-settings.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/iran-agency-map/admin/agency-item-lists.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/iran-agency-map/admin/iam-admin-menu.php:22
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/iran-agency-map/admin/agency-item-lists.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/iran-agency-map/public/iam-shortcode.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/iran-agency-map/admin/agency-item-lists.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: iran agency map, agencies, iran map

iran-agency-map/iran-agency-map.php Passed 13 tests

The primary PHP file in "Iran agency map" version 1.0.3 is used by WordPress to initiate all plugin functionality
127 characters long description:
The Iran-agency-map plugin is a great plugin for Iranian companies that they can display their agencies on a beautiful SVG map.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,487 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP11187255991
CSS2384232
PO File18185179
JavaScript552585

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/iam-mobile.png0.26KB0.26KB0.00%
public/img/iam-phone.png0.27KB0.28KB0.00%
public/img/iam-location.png0.29KB0.29KB0.00%
public/img/iam-address.png0.18KB0.19KB0.00%
public/img/iam-user.png0.32KB0.33KB0.00%