10% add-zip-codes-to-posts

Code Review | USA Zip Codes by WP Monsters

WordPress plugin USA Zip Codes by WP Monsters scored 10% from 54 tests.

About plugin

  • Plugin page: add-zip-codes-to-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-4.7.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2016
  • Latest release: Feb 9, 2017
  • Number of updates: 12
  • Update frequency: every 28.5 days
  • Top authors: Wordpress Monsters (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 1,210 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/add-zip-codes-to-posts/zip-codes.php+104
    file_get_contents(http://wp.com/wp-content/plugins/zip-codes/wpm_zip.sql): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

Server metrics [RAM: ▼0.82MB] [CPU: ▼28.11ms] Passed 4 tests

A check of server-side resources used by USA Zip Codes by WP Monsters
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▼0.0239.50 ▼11.25
Dashboard /wp-admin3.32 ▲0.0144.55 ▼28.64
Posts /wp-admin/edit.php3.37 ▼0.4858.32 ▲7.51
Add New Post /wp-admin/post-new.php3.10 ▼2.7933.46 ▼73.61
Media Library /wp-admin/upload.php3.24 ▲0.0133.41 ▲1.08
Zip-codes /wp-admin/options-general.php?page=optionZipCodes3.2328.53

Server storage [IO: ▲2.50MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: 1 new table, 6 new options
New tables
wp_zipcodes
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by USA Zip Codes by WP Monsters
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.15 ▼1.504.88 ▲3.0543.56 ▼8.36
Dashboard /wp-admin2,214 ▲324.84 ▼0.12115.57 ▲9.9647.36 ▼6.50
Posts /wp-admin/edit.php2,097 ▲112.02 ▲0.0145.65 ▲10.8843.12 ▲7.32
Add New Post /wp-admin/post-new.php1,521 ▲717.59 ▲0.01650.11 ▼67.0353.45 ▼14.94
Media Library /wp-admin/upload.php1,399 ▲84.20 ▲0.0194.28 ▼2.1442.95 ▼2.76
Zip-codes /wp-admin/options-general.php?page=optionZipCodes8232.0625.6932.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.08MB] 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
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-zip-codes-to-posts/zip-codes.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=optionZipCodes
    • > Network (severe)
    wp-content/plugins/zip-codes/css/style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=optionZipCodes
    • > Network (severe)
    wp-content/plugins/zip-codes/js/zip-codes.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screenshot shows how the plugin looks in admin side.), #2 (This screenshot shows the array you get after use get_post_meta().), #3 (This screenshot shows the settings page of this plugin.)
The official readme.txt might help

add-zip-codes-to-posts/zip-codes.php 92% from 13 tests

This is the main PHP file of "USA Zip Codes by WP Monsters" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-zip-codes-to-posts.php" instead of "zip-codes.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 detected43,568 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
SQL10043,192
PHP13530155
CSS1211131
JavaScript1191190

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png31.50KB10.21KB▼ 67.58%
screenshot-2.png9.09KB1.25KB▼ 86.29%
screenshot-3.png38.90KB12.07KB▼ 68.96%