84% whats-my-ip

Code Review | whats-my-ip

WordPress plugin whats-my-ip scored84%from 54 tests.

About plugin

  • Plugin page: whats-my-ip
  • Plugin version: 0.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.9.2
  • WordPress version: 6.3.1
  • First release: May 1, 2014
  • Latest release: Aug 7, 2014
  • Number of updates: 48
  • Update frequency: every 2.0 days
  • Top authors: dsawardekar (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /1,901 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.28MB] [CPU: ▲0.99ms] Passed 4 tests

Analyzing server-side resources used by whats-my-ip
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2949.66 ▲1.74
Dashboard /wp-admin3.58 ▲0.2847.27 ▲0.91
Posts /wp-admin/edit.php3.63 ▲0.2847.52 ▼0.62
Add New Post /wp-admin/post-new.php6.16 ▲0.28110.18 ▲4.05
Media Library /wp-admin/upload.php3.50 ▲0.2836.85 ▲1.92

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 233 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_whats-my-ip-widget
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

whats-my-ip: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.19 ▼1.391.82 ▼0.3643.53 ▼1.76
Dashboard /wp-admin2,209 ▲215.86 ▼0.00102.27 ▼1.0843.75 ▲0.70
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0637.11 ▼4.4931.63 ▼6.20
Add New Post /wp-admin/post-new.php1,538 ▲1823.01 ▼0.19674.31 ▲37.0461.60 ▲12.29
Media Library /wp-admin/upload.php1,391 ▲64.20 ▼0.0898.12 ▼6.9841.85 ▼0.70

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_whats-my-ip-widget
    • widget_recent-posts

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 140× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/TokenParser/Extends.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Arrow\\Asset\\Asset' not found in wp-content/plugins/whats-my-ip/vendor/dsawardekar/arrow/lib/Arrow/Asset/Stylesheet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Node/Set.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Error/Loader.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Function' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Function/Node.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Encase\\ContainerItem' not found in wp-content/plugins/whats-my-ip/vendor/dsawardekar/encase-php/src/Encase/FactoryItem.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Node/Sandbox.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_Sandbox_SecurityPolicyInterface' not found in wp-content/plugins/whats-my-ip/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: geoip, ip

whats-my-ip/whats-my-ip.php Passed 13 tests

The main PHP file in "whats-my-ip" ver. 0.5.2 adds more information about the plugin and also serves as the entry point for this plugin
49 characters long description:
Display User's IP address via Widget or Shortcode

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected11,514 lines of code in 225 files:
LanguageFilesBlank linesComment linesLines of code
PHP2172,6855,12011,115
JSON100248
JavaScript233090
Twig37036
YAML16019
Markdown1406

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity6.85
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces9
Interfaces20
Traits0
Classes193
▷ Abstract classes105.18%
▷ Concrete classes18394.82%
▷ Final classes00.00%
Methods1,145
▷ Static methods161.40%
▷ Public methods1,03590.39%
▷ Protected methods1089.43%
▷ Private methods20.17%
Functions52
▷ Named functions5198.08%
▷ Anonymous functions11.92%
Constants38
▷ Global constants12.63%
▷ Class constants3797.37%
▷ Public constants37100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected