73% wp-geo-based-content

Code Review | WP Geo Based Content

WordPress plugin WP Geo Based Content scored 73% from 54 tests.

About plugin

  • Plugin page: wp-geo-based-content
  • Plugin version: 1.07
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.3
  • WordPress version: 6.3.1
  • First release: Aug 5, 2015
  • Latest release: Aug 11, 2015
  • Number of updates: 11
  • Update frequency: every 0.6 days
  • Top authors: lior1970 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,227 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.90ms] Passed 4 tests

An overview of server-side resources used by WP Geo Based Content
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.55 ▼3.99
Dashboard /wp-admin3.33 ▲0.0247.20 ▼3.15
Posts /wp-admin/edit.php3.44 ▲0.0848.31 ▲3.87
Add New Post /wp-admin/post-new.php5.93 ▲0.0495.10 ▼4.80
Media Library /wp-admin/upload.php3.25 ▲0.0234.35 ▲0.35
WP GEO /wp-admin/admin.php?page=wpgeo-campaigns3.2530.08
Add New Geo Shortcode /wp-admin/admin.php?page=wpgeo-campaigns&action=add3.2837.99

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: 2 new tables, 7 new options
New tables
wp_wpgeo_banners
wp_wpgeo_campaign
New WordPress options
wpgeo_version
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP Geo Based Content
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.23 ▼1.161.56 ▼0.3538.99 ▼6.49
Dashboard /wp-admin2,238 ▲504.82 ▼1.00109.77 ▲3.7339.64 ▼6.75
Posts /wp-admin/edit.php2,118 ▲292.01 ▼0.0039.04 ▲5.0635.04 ▼0.64
Add New Post /wp-admin/post-new.php1,552 ▲2423.45 ▲4.88668.27 ▲67.2362.21 ▲14.53
Media Library /wp-admin/upload.php1,417 ▲324.21 ▲0.0198.44 ▼0.5544.68 ▼1.03
WP GEO /wp-admin/admin.php?page=wpgeo-campaigns8612.0625.0026.37
Add New Geo Shortcode /wp-admin/admin.php?page=wpgeo-campaigns&action=add2,8336.57128.41119.86

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 9× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-geo-based-content/includes/class-admin.php
    • > /wp-content/plugins/wp-geo-based-content/includes/class-model.php
    • > /wp-content/plugins/wp-geo-based-content/core/wpgeo_content-class.php
    • > /wp-content/plugins/wp-geo-based-content/includes/views/admin/form.php
    • > /wp-content/plugins/wp-geo-based-content/index.php
    • > /wp-content/plugins/wp-geo-based-content/wp-geo-based-content.php
    • > /wp-content/plugins/wp-geo-based-content/core/config.php
    • > /wp-content/plugins/wp-geo-based-content/includes/class-public.php
    • > /wp-content/plugins/wp-geo-based-content/includes/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-geo-based-content/includes/views/admin/lists.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpgeo-campaigns&action=add
    • > Network (severe)
    wp-content/plugins/wp_geo_based_content/includes/css/wpgeo-admin-style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpgeo-campaigns&action=add
    • > Network (severe)
    wp-content/plugins/wp_geo_based_content/includes/js/ZeroClipboard.min.js?ver=2.2.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpgeo-campaigns&action=add
    • > Network (severe)
    wp-content/plugins/wp_geo_based_content/includes/js/wpgeo-admin-main.js?ver=1.07 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-geo-based-content === )
Please take inspiration from this readme.txt

wp-geo-based-content/wp-geo-based-content.php Passed 13 tests

The main file in "WP Geo Based Content" v. 1.07 serves as a complement to information provided in readme.txt and as the entry point to the plugin
96 characters long description:
This plugin let you display different content for different audience based on their geo location

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
Everything looks great! No dangerous files found in this plugin940 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP1016278847
CSS116163
JavaScript2111330

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity16.75
▷ Minimum class complexity2.00
▷ Maximum class complexity48.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin