72% visited-provinces

Code Review | Visited Provinces

WordPress plugin Visited Provinces scored72%from 54 tests.

About plugin

  • Plugin page: visited-provinces
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 28, 2014
  • Latest release: Nov 28, 2014
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: pcsforme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /631 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.21ms] Passed 4 tests

Server-side resources used by Visited Provinces
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.51 ▼3.07
Dashboard /wp-admin3.38 ▲0.0746.32 ▼2.53
Posts /wp-admin/edit.php3.49 ▲0.1349.37 ▲0.51
Add New Post /wp-admin/post-new.php5.96 ▲0.0793.41 ▼11.73
Media Library /wp-admin/upload.php3.30 ▲0.0738.27 ▲2.68
Settings /wp-admin/admin.php?page=vca-settings3.2431.38
Provinces /wp-admin/admin.php?page=vca-visited-provinces3.2430.82

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
vca_provinces
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
vca_settings

Browser metrics Passed 4 tests

An overview of browser requirements for Visited Provinces
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲11713.54 ▼0.831.79 ▲0.0138.69 ▼10.19
Dashboard /wp-admin2,236 ▲454.85 ▼0.97100.22 ▼6.1438.41 ▼2.55
Posts /wp-admin/edit.php2,116 ▲272.01 ▼0.0338.89 ▼2.0036.19 ▼0.42
Add New Post /wp-admin/post-new.php1,556 ▲2223.27 ▲0.09653.12 ▲51.9160.51 ▲2.11
Media Library /wp-admin/upload.php1,418 ▲304.22 ▲0.03114.67 ▲15.8546.88 ▼1.93
Settings /wp-admin/admin.php?page=vca-settings9872.4243.5531.11
Provinces /wp-admin/admin.php?page=vca-visited-provinces9662.4040.0330.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+10
    Illegal string offset 'theme'
  • 39 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Notice in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Uninitialized string offset: 0
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+25
    Illegal string offset 'waterColor'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+44
    Illegal string offset 'color'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+45
    Illegal string offset 'colorSolid'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+46
    Illegal string offset 'selectedColor'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+47
    Illegal string offset 'outlineColor'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+48
    Illegal string offset 'rollOverColor'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_map.php+49
    Illegal string offset 'rollOverOutlineColor'
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-settings
    • > Notice in wp-content/plugins/visited-provinces/inc/vca_settings_page.php+43
    Undefined variable: selected
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-AB'
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Notice in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+53
    Undefined variable: c
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-BC'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-MB'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-NB'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-NL'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-NS'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-NT'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-NU'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-ON'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-PE'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-QC'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-SK'
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Warning in wp-content/plugins/visited-provinces/inc/vca_provinces_page.php+49
    Illegal string offset 'CA-YT'

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
Almost there! Just fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/visited-provinces/inc/vca_map.php
    • > /wp-content/plugins/visited-provinces/inc/vca_settings_page.php
    • > /wp-content/plugins/visited-provinces/inc/vca_provinces_page.php
    • > /wp-content/plugins/visited-provinces/np_visit_canada.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vca-visited-provinces
    • > Network (severe)
    wp-content/plugins/visited-provinces/ammap/themes/.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === visited-provinces === )
  • Screenshots: Please add descriptions for these screenshots #2, #3 in visited-provinces/assets to your readme.txt
The official readme.txt is a good inspiration

visited-provinces/np_visit_canada.php 92% from 13 tests

The principal PHP file in "Visited Provinces" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("visited-provinces.php" instead of "np_visit_canada.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,347 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6124141,029
PHP45324318

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
ammap/images/export.png0.21KB0.13KB▼ 38.07%