78% geo-ip-library

Code Review | Geo IP Library

WordPress plugin Geo IP Library scored78%from 54 tests.

About plugin

  • Plugin page: geo-ip-library
  • Plugin version: 0.9.7
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.8.2
  • WordPress version: 6.3.1
  • First release: Oct 17, 2017
  • Latest release: Oct 18, 2017
  • Number of updates: 18
  • Update frequency: every 0.1 days
  • Top authors: ricardomiguel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /816 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲43.94MB] [CPU: ▲36.11ms] 50% from 4 tests

An overview of server-side resources used by Geo IP Library
Please have a look at the following items
  • RAM: Total memory usage must be kept under 10MB (currently 47.95MB on /wp-admin/tools.php?page=geo-ip-library-settings)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 43.94MB on /wp-admin/tools.php?page=geo-ip-library-settings)
PageMemory (MB)CPU Time (ms)
Home /47.93 ▲44.4779.01 ▲37.90
Dashboard /wp-admin47.95 ▲44.6599.32 ▲45.11
Posts /wp-admin/edit.php47.95 ▲44.6097.11 ▲47.79
Add New Post /wp-admin/post-new.php47.95 ▲42.06117.90 ▲21.56
Media Library /wp-admin/upload.php47.95 ▲44.7273.51 ▲39.85
Geo IP Library /wp-admin/tools.php?page=geo-ip-library-settings47.9572.24

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Geo IP Library
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.21 ▼1.162.03 ▲0.2536.45 ▼6.30
Dashboard /wp-admin2,210 ▲194.84 ▼0.04109.12 ▲2.3739.65 ▼9.10
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0540.65 ▼3.0635.93 ▼5.76
Add New Post /wp-admin/post-new.php1,546 ▲2724.41 ▲0.91642.80 ▲37.4662.50 ▲13.73
Media Library /wp-admin/upload.php1,392 ▲14.22 ▲0.0296.46 ▼8.0440.02 ▼6.69
Geo IP Library /wp-admin/tools.php?page=geo-ip-library-settings1,1301.6823.6451.56

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/geo-ip-library/geo-ip-library.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require(GEO_IP_LIBRARY_PATHincludes/class-geoiplibrary.php): failed to open stream: No such file or directory in wp-content/plugins/geo-ip-library/includes/class-core.php on line 15
    • > PHP Warning
      Use of undefined constant GEO_IP_LIBRARY_PATH - assumed 'GEO_IP_LIBRARY_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/geo-ip-library/includes/class-core.php on line 15
    • > PHP Fatal error
      require(): Failed opening required 'GEO_IP_LIBRARY_PATHincludes/class-geoiplibrary.php' (include_path='.:/usr/share/php') in wp-content/plugins/geo-ip-library/includes/class-core.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: library, geo location, standalone, custom content, geo ip

geo-ip-library/geo-ip-library.php Passed 13 tests

"Geo IP Library" version 0.9.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
78 characters long description:
Provides simple country location features by using Chir's geolocation library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected4,593 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP8973983,236
CSS4681449
Sass2890428
JavaScript336112313
HTML200167

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.33
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo_small.png11.74KB3.56KB▼ 69.67%
assets/img/logo.png21.64KB6.14KB▼ 71.64%