78% belingogeo

Code Review | belingoGeo

WordPress plugin belingoGeo scored78%from 54 tests.

About plugin

  • Plugin page: belingogeo
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Jul 9, 2022
  • Latest release: Oct 14, 2023
  • Number of updates: 58
  • Update frequency: every 8.0 days
  • Top authors: belingo (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /2,445 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 gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.34ms] Passed 4 tests

A check of server-side resources used by belingoGeo
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1143.53 ▲6.36
Dashboard /wp-admin3.43 ▲0.0850.96 ▼7.04
Posts /wp-admin/edit.php3.48 ▲0.1245.11 ▲0.68
Add New Post /wp-admin/post-new.php6.03 ▲0.1481.64 ▼5.00
Media Library /wp-admin/upload.php3.35 ▲0.1235.99 ▲2.02
Cities /wp-admin/edit.php?post_type=cities3.4439.62
Regions /wp-admin/edit-tags.php?taxonomy=bg_regions&post_type=cities3.3430.94

Server storage [IO: ▲37.31MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • Total filesystem usage must be limited to 25MB (currently using 37.31MB)
Filesystem: 35 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
belingo_geo_exclude_nonobject
can_compress_scripts
belingo_geo_sitemap_per_page
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
belingo_geo_url_type

Browser metrics Passed 4 tests

This is an overview of browser requirements for belingoGeo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲14213.62 ▼0.5912.48 ▲10.8142.46 ▲2.91
Dashboard /wp-admin2,231 ▲575.82 ▲0.2190.90 ▲8.3283.20 ▲42.30
Posts /wp-admin/edit.php2,151 ▲512.24 ▲0.2536.17 ▲1.1034.52 ▼1.86
Add New Post /wp-admin/post-new.php1,568 ▲4023.13 ▼0.30699.49 ▲53.3852.04 ▼2.58
Media Library /wp-admin/upload.php1,451 ▲514.45 ▲0.2693.82 ▼4.0180.96 ▲35.80
Cities /wp-admin/edit.php?post_type=cities1,7012.2534.9129.75
Settings /wp-admin/belingo_geo_settings.php260.420.1013.40
Import /wp-admin/belingo_geo_settings.php?page=belingogeo_import260.420.067.02
Export /wp-admin/belingo_geo_settings.php?page=belingogeo_export260.420.096.18
Regions /wp-admin/edit-tags.php?taxonomy=bg_regions&post_type=cities1,3131.9629.0431.88
About plugin /wp-admin/belingo_geo_about.php260.420.066.53

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • db_upgraded
    • belingo_geo_sitemap_per_page
    • widget_recent-comments
    • belingo_geo_url_type
    • widget_recent-posts
    • belingo_geo_exclude_nonobject
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please fix the following items
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/belingogeo/integrations/yoast.php:3
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/belingogeo/templates/cities_addon_contacts.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/belingogeo/includes/admin/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/belingogeo/includes/shortcodes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/belingogeo/includes/hooks.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/belingogeo/integrations/woocommerce.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/belingogeo/includes/sitemaps.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/belingogeo/includes/admin/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/belingogeo/belingoGeo.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/belingogeo/includes/ajax-functions.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/belingo_geo_settings.php
    • > Network (severe)
    wp-admin/belingo_geo_settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/belingo_geo_settings.php?page=belingogeo_import
    • > Network (severe)
    wp-admin/belingo_geo_settings.php?page=belingogeo_import - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/belingo_geo_settings.php?page=belingogeo_export
    • > Network (severe)
    wp-admin/belingo_geo_settings.php?page=belingogeo_export - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/belingo_geo_about.php
    • > Network (severe)
    wp-admin/belingo_geo_about.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: geotargeting, geolocation, change content based on location, targeted content, geo content...

belingogeo/belingoGeo.php 85% from 13 tests

The primary PHP file in "belingoGeo" version 1.9 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 160 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("belingogeo.php" instead of "belingoGeo.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
Success! There were no dangerous files found in this plugin3,888 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP20636642,848
CSS2842491
PO File1110119328
JavaScript3171221

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity40.00
▷ Minimum class complexity2.00
▷ Maximum class complexity78.00
Average method complexity4.90
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1575.00%
▷ Protected methods525.00%
▷ Private methods00.00%
Functions103
▷ Named functions10198.06%
▷ Anonymous functions21.94%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo_mini_20x20.png0.85KB0.75KB▼ 11.49%