84% wp-geonames

Code Review | WP GeoNames

WordPress plugin WP GeoNames scored84%from 54 tests.

About plugin

  • Plugin page: wp-geonames
  • Plugin version: 1.8
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Nov 27, 2014
  • Latest release: Jun 7, 2022
  • Number of updates: 60
  • Update frequency: every 45.8 days
  • Top authors: sojahu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /12,947 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼8.20ms] Passed 4 tests

An overview of server-side resources used by WP GeoNames
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0738.51 ▼8.15
Dashboard /wp-admin3.53 ▲0.2348.75 ▼6.47
Posts /wp-admin/edit.php3.64 ▲0.2950.75 ▼4.55
Add New Post /wp-admin/post-new.php6.13 ▲0.2583.65 ▼13.64
Media Library /wp-admin/upload.php3.45 ▲0.2335.92 ▲1.04
WP GeoNames /wp-admin/options-general.php?page=wpGeonames-options3.55377.38

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: 2 new tables, 7 new options
New tables
wp_geonamesPostal
wp_geonames
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
wpGeonames_dataList
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP GeoNames
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲1313.80 ▼0.481.75 ▼0.2340.30 ▼4.60
Dashboard /wp-admin2,205 ▲315.47 ▼0.22102.56 ▲4.1338.51 ▼6.13
Posts /wp-admin/edit.php2,110 ▲102.67 ▲0.6941.64 ▼0.6236.85 ▲3.71
Add New Post /wp-admin/post-new.php1,533 ▲523.54 ▲0.52640.12 ▲5.2153.40 ▲1.39
Media Library /wp-admin/upload.php1,410 ▲105.16 ▲0.94100.38 ▼0.8744.59 ▲3.79
WP GeoNames /wp-admin/options-general.php?page=wpGeonames-options6,6373.3172.0049.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/wp-geonames/patch.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-geonames/wp-geonames.php:11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/wp-geonames/patch.php:7
    • > PHP Notice
      Undefined variable: shortcode in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php on line 13
    • > PHP Notice
      Undefined variable: shortcode in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php on line 14
    • > PHP Notice
      Undefined variable: shortcode in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-geonames/templates/wp-geonames_location_taxonomy.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (WP-GeoNames main tab in the Dashboard.), #2 (Check your database in Dashboard.)
You can look at the official readme.txt

wp-geonames/wp-geonames.php 92% from 13 tests

The entry point to "WP GeoNames" version 1.8 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes

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
No dangerous file extensions were detected2,202 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP6231051,155
CSS25324564
PO File2164172402
JavaScript202581

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions28
▷ Named functions28100.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
leaflet/images/layers.png0.68KB1.05KB0.00%
images/geonames.png10.11KB3.80KB▼ 62.43%
leaflet/images/marker-icon.png1.43KB1.55KB0.00%
images/reload.png3.05KB0.36KB▼ 88.09%