78% visited-states

Code Review | Visited US States

WordPress plugin Visited US States scored78%from 54 tests.

About plugin

  • Plugin page: visited-states
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 23, 2014
  • Latest release: Nov 25, 2014
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: pcsforme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,247 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Visited US States
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.26 ▼5.50
Dashboard /wp-admin3.38 ▲0.0445.75 ▼19.74
Posts /wp-admin/edit.php3.50 ▲0.1445.91 ▼3.11
Add New Post /wp-admin/post-new.php5.96 ▲0.0883.03 ▼10.08
Media Library /wp-admin/upload.php3.31 ▲0.0835.09 ▲0.82
States /wp-admin/admin.php?page=vus-visited-states3.2530.86
Settings /wp-admin/admin.php?page=vus-settings3.2529.79

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
vus_settings
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
vus_states
vus_plugin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Visited US States
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.18 ▼1.431.69 ▼0.2239.96 ▼1.98
Dashboard /wp-admin2,236 ▲455.90 ▲0.06108.53 ▲4.6040.85 ▼3.56
Posts /wp-admin/edit.php2,116 ▲272.06 ▼0.0034.92 ▲0.9733.25 ▼4.78
Add New Post /wp-admin/post-new.php1,564 ▲5018.54 ▼5.04623.03 ▲18.9349.47 ▲2.74
Media Library /wp-admin/upload.php1,415 ▲244.16 ▼0.0693.01 ▼5.4741.29 ▼2.11
States /wp-admin/admin.php?page=vus-visited-states1,1592.4142.5832.81
Settings /wp-admin/admin.php?page=vus-settings1,0312.4040.7028.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • vus_settings
    • widget_theysaidso_widget
    • widget_recent-posts
    • vus_plugin_options
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 50 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vus-visited-states
    • > Notice in wp-content/plugins/visited-states/inc/vus_states_page.php+108
    Undefined variable: c
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=vus-settings
    • > Notice in wp-content/plugins/visited-states/inc/vus_settings_page.php+43
    Undefined variable: selected

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
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/visited-states/np_visited_states.php
    • > /wp-content/plugins/visited-states/inc/vus_settings_page.php
    • > /wp-content/plugins/visited-states/inc/vus_map.php
    • > /wp-content/plugins/visited-states/inc/vus_states_page.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === visited-states === )
You can take inspiration from this readme.txt

visited-states/np_visited_states.php 92% from 13 tests

"Visited US States" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("visited-states.php" instead of "np_visited_states.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,576 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6114141,210
PHP45241366

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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%