94% municipal-boundaries

Code Review | Municipal Boundaries

WordPress plugin Municipal Boundaries scored 94% from 54 tests.

About plugin

  • Plugin page: municipal-boundaries
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 5.8.1
  • First release: Jun 4, 2020
  • Latest release: Aug 4, 2020
  • Number of updates: 23
  • Update frequency: every 2.7 days
  • Top authors: yiannisdesp4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 250 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Municipal Boundaries
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0128.20 ▼11.63
Dashboard /wp-admin3.08 ▲0.0249.21 ▲13.00
Posts /wp-admin/edit.php3.16 ▲0.0645.62 ▲4.02
Add New Post /wp-admin/post-new.php5.43 ▲0.0088.89 ▼573.66
Media Library /wp-admin/upload.php3.02 ▲0.0232.95 ▲0.38
Municipal Boundaries /wp-admin/options-general.php?page=municipal-boundaries_options2.9928.73

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 70 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Municipal Boundaries
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,712 ▲11616.00 ▲0.3711.46 ▲1.6049.65 ▼5.25
Dashboard /wp-admin2,998 ▲645.95 ▲0.01134.04 ▼2.88109.95 ▼7.48
Posts /wp-admin/edit.php2,748 ▲92.70 ▼0.0262.51 ▼1.5790.07 ▲1.06
Add New Post /wp-admin/post-new.php1,879 ▲919.17 ▼0.24365.60 ▼8.11113.44 ▲0.86
Media Library /wp-admin/upload.php1,816 ▲95.03 ▼0.01165.56 ▲20.95115.86 ▲2.26
Municipal Boundaries /wp-admin/options-general.php?page=municipal-boundaries_options1,0402.3054.0775.75

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/municipal-boundaries/admin/partials/municipal-boundaries-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: municipalities, googlemap, boundaries, ucm, cyprus...

municipal-boundaries/municipal-boundaries.php Passed 13 tests

The main PHP script in "Municipal Boundaries" version 1.1.4 is automatically included on every request by WordPress
69 characters long description:
Renders current Municipal Boundaries on Google Map based on KML data.

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
There were no executable files found in this plugin2,565 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
XML7001,150
JavaScript321421,027
PHP12132532288
CSS271488
Markdown15012

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.25
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2681.25%
▷ Protected methods00.00%
▷ Private methods618.75%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
39 PNG files occupy 2.21MB with 1.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/tseri.png69.29KB26.26KB▼ 62.09%
public/img/egkomi.png13.84KB5.30KB▼ 61.71%
public/img/lemesos.png85.65KB29.17KB▼ 65.95%
public/img/keryneia.png83.68KB31.84KB▼ 61.95%
public/img/paphos.png66.02KB23.66KB▼ 64.17%