89% ymc-states-map

Code Review | States Map US

WordPress plugin States Map US scored89%from 54 tests.

About plugin

  • Plugin page: ymc-states-map
  • Plugin version: 2.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Oct 21, 2022
  • Latest release: Nov 4, 2023
  • Number of updates: 19
  • Update frequency: every 20.0 days
  • Top authors: wssoffice21 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /454 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.56ms] Passed 4 tests

An overview of server-side resources used by States Map US
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.06 ▼4.42
Dashboard /wp-admin3.35 ▲0.0046.67 ▼16.29
Posts /wp-admin/edit.php3.46 ▲0.1156.97 ▲13.20
Add New Post /wp-admin/post-new.php5.95 ▲0.0789.86 ▼6.21
Media Library /wp-admin/upload.php3.27 ▲0.0432.92 ▲0.68
Add New /wp-admin/post-new.php?post_type=states_map3.9852.71
States Map US /wp-admin/edit.php?post_type=states_map3.3144.15

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics 75% from 4 tests

Checking browser requirements for States Map US
Please improve the following
  • Script duration: Total JavaScript execution time should be lower than 1,500.00ms (currently 2,331.04ms on /wp-admin/post-new.php?post_type=states_map)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲18413.92 ▼0.438.68 ▲6.8441.67 ▼3.87
Dashboard /wp-admin2,234 ▲605.80 ▲0.2296.32 ▼0.9942.79 ▼0.87
Posts /wp-admin/edit.php2,150 ▲472.27 ▲0.3341.41 ▲2.1134.45 ▼2.55
Add New Post /wp-admin/post-new.php1,564 ▲3823.34 ▲0.14620.77 ▼28.1233.18 ▼12.94
Media Library /wp-admin/upload.php1,448 ▲484.39 ▲0.1597.36 ▼14.6641.75 ▼3.72
Add New /wp-admin/post-new.php?post_type=states_map16,96452.482,331.04138.89
States Map US /wp-admin/edit.php?post_type=states_map1,1112.2038.1626.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: custom taxonomy, usa, map, taxonomy, posts

ymc-states-map/ymc-states-map.php 92% from 13 tests

The main PHP script in "States Map US" version 2.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin4,234 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP113092833,046
SVG1140629
Sass3422407
JavaScript24011149
CSS2222
Markdown1001

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 165)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity38.44
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity12.20
▷ Minimum method complexity1.00
▷ Maximum method complexity165.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2890.32%
▷ Protected methods00.00%
▷ Private methods39.68%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants9
▷ Global constants333.33%
▷ Class constants666.67%
▷ Public constants6100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.57MB with 0.28MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/bg_popup.png516.75KB260.98KB▼ 49.50%
includes/assets/images/map_usa.png71.82KB37.33KB▼ 48.02%