79% neshan-maps

Code Review | Neshan Maps

WordPress plugin Neshan Maps scored 79% from 54 tests.

About plugin

  • Plugin page: neshan-maps
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 5.9.2
  • First release: Jul 15, 2018
  • Latest release: Sep 9, 2018
  • Number of updates: 24
  • Update frequency: every 2.3 days
  • Top authors: neshanmaps (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active / 7,858 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼300.64ms] Passed 4 tests

This is a short check of server-side resources used by Neshan Maps
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.5755.08 ▲18.63
Dashboard /wp-admin3.53 ▲0.1233.52 ▼46.21
Posts /wp-admin/edit.php3.76 ▲0.1242.96 ▲3.66
Add New Post /wp-admin/post-new.php7.00 ▲0.0294.56 ▼1,173.32
Media Library /wp-admin/upload.php3.41 ▲0.1137.26 ▲13.30
My Maps /wp-admin/admin.php?page=neshan_maps3.3931.35
Create New Map /wp-admin/admin.php?page=neshan_maps_create3.4525.54
Usage Help /wp-admin/admin.php?page=neshan_maps_help3.3625.06

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 47 new files
Database: 1 new table, no new options
New tables
neshan_maps

Browser metrics Passed 4 tests

Neshan Maps: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,849 ▲9518.15 ▲2.5044.27 ▲37.332.57 ▲0.02
Dashboard /wp-admin2,931 ▲706.18 ▲0.02117.28 ▼21.82158.11 ▼5.01
Posts /wp-admin/edit.php2,731 ▲613.23 ▼0.0163.05 ▼24.77153.15 ▼17.18
Add New Post /wp-admin/post-new.php1,780 ▲14117.26 ▼4.30413.47 ▼32.55203.20 ▲59.52
Media Library /wp-admin/upload.php1,734 ▲395.56 ▲0.04155.64 ▲6.67393.85 ▲188.65
My Maps /wp-admin/admin.php?page=neshan_maps1,0642.4271.61117.89
Create New Map /wp-admin/admin.php?page=neshan_maps_create1,4424.1091.96252.68
Usage Help /wp-admin/admin.php?page=neshan_maps_help9962.4252.3395.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • neshan_maps

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=neshan_maps_help
    • > Warning in wp-content/plugins/neshan-maps/admin/class-neshan-maps-admin.php+307
    include_once(wp-content/plugins/neshan-maps/admin/partials/help-en.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=neshan_maps_help
    • > Warning in wp-content/plugins/neshan-maps/admin/class-neshan-maps-admin.php+307
    include_once(): Failed opening 'wp-content/plugins/neshan-maps/admin/partials/help-en.php' for inclusion (include_path='.:/usr/share/php')

SRP 50% 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
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'lat' of non-object in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 27
    • > PHP Notice
      Trying to get property 'lng' of non-object in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 27
    • > PHP Notice
      Trying to get property 'maptype' of non-object in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/neshan-maps/admin/partials/my-maps.php:19
    • > PHP Notice
      Trying to get property 'api_key' of non-object in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 25
    • > PHP Notice
      Undefined variable: current_map in wp-content/plugins/neshan-maps/admin/partials/create-simple-map.php on line 16
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 25
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 28
    • > PHP Notice
      Trying to get property 'zoom' of non-object in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 28
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/neshan-maps/public/partials/simple-map.php on line 17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: persian map, map, google maps, static maps, maps...

neshan-maps/neshan-maps.php Passed 13 tests

Analyzing the main PHP file in "Neshan Maps" version 1.1.4
65 characters long description:
Handy tool for creating stylized maps using Neshan Maps Platform.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,569 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP15220637814
JavaScript511049336
CSS72618281
PO File179126113
SVG10025

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
12 PNG files occupy 0.19MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/marker_red.png1.73KB0.77KB▼ 55.72%
admin/images/map-types-standard-night.png8.22KB3.53KB▼ 57.00%
admin/images/marker-1.png0.96KB1.04KB0.00%
admin/images/map-types-neshan.png8.79KB3.69KB▼ 57.99%
admin/images/marker-2.png2.42KB1.55KB▼ 35.80%