77% ip2phrase-widget

Code Review | IP2Phrase

WordPress plugin IP2Phrase scored77%from 54 tests.

About plugin

  • Plugin page: ip2phrase-widget
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 3, 2012
  • Latest release: Nov 10, 2023
  • Number of updates: 41
  • Update frequency: every 105.7 days
  • Top authors: ip2location (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,480 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.65ms] Passed 4 tests

A check of server-side resources used by IP2Phrase
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.98 ▼4.00
Dashboard /wp-admin3.32 ▲0.0144.57 ▲0.32
Posts /wp-admin/edit.php3.37 ▲0.0144.77 ▼4.26
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.27 ▲1.35
Media Library /wp-admin/upload.php3.24 ▲0.0136.25 ▲3.84

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for IP2Phrase
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3214.37 ▲0.121.99 ▲0.1844.58 ▲2.38
Dashboard /wp-admin2,199 ▲295.60 ▼0.0485.53 ▼15.8737.16 ▼4.10
Posts /wp-admin/edit.php2,101 ▲11.96 ▼0.0036.48 ▼4.9635.07 ▼4.20
Add New Post /wp-admin/post-new.php1,529 ▲323.51 ▲0.47601.69 ▼106.2647.71 ▼11.28
Media Library /wp-admin/upload.php1,407 ▲74.18 ▼0.0594.66 ▼23.0542.98 ▼3.59
IP2Phrase /wp-admin/IP2Phrase.php260.410.0813.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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)
Everything seems fine, however 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ip2phrase-widget/IP2Phrase.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/IP2Phrase.php
    • > Network (severe)
    wp-admin/IP2Phrase.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: Screenshot #1 (Tags available) image required
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === ip2phrase-widget === )
You can look at the official readme.txt

ip2phrase-widget/IP2Phrase.php 85% from 13 tests

The primary PHP file in "IP2Phrase" version 1.0.14 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: A good plugin description is longer than 10 characters (currently 0 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ip2phrase-widget.php" instead of "IP2Phrase.php")

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 detected345 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1399285
JavaScript19060

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.33
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
No PNG files were detected