84% real-ip-and-geo-for-cloudflare

Code Review | Real IP and Geo for Cloudflare

WordPress plugin Real IP and Geo for Cloudflare scored84%from 54 tests.

About plugin

  • Plugin page: real-ip-and-geo-f...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 6.3.1
  • First release: May 30, 2018
  • Latest release: Dec 8, 2018
  • Number of updates: 4
  • Update frequency: every 48.0 days
  • Top authors: rammichael (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,798 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.44ms] Passed 4 tests

A check of server-side resources used by Real IP and Geo for Cloudflare
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.91 ▼2.64
Dashboard /wp-admin3.31 ▲0.0149.22 ▼9.57
Posts /wp-admin/edit.php3.36 ▲0.0049.83 ▼3.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.29 ▼18.17
Media Library /wp-admin/upload.php3.23 ▲0.0042.01 ▲5.65

Server storage [IO: ▲0.03MB] [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: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Real IP and Geo for Cloudflare
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▲0.061.79 ▼0.2046.61 ▲4.29
Dashboard /wp-admin2,192 ▲155.61 ▲0.0190.42 ▼0.4542.05 ▼3.54
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0539.09 ▼0.4036.05 ▲0.89
Add New Post /wp-admin/post-new.php1,526 ▼023.75 ▲0.74626.68 ▼2.1057.34 ▲7.04
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0696.92 ▼9.6641.23 ▼5.51

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/real-ip-and-geo-for-cloudflare/real-ip-and-geo-for-cloudflare.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The admin panel with the plugin activated) image not found
You can take inspiration from this readme.txt

real-ip-and-geo-for-cloudflare/real-ip-and-geo-for-cloudflare.php Passed 13 tests

"Real IP and Geo for Cloudflare" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
74 characters long description:
Saves and displays visitors' real IP and location, instead of Cloudflare's

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin27 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP131027

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.70
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png22.60KB12.49KB▼ 44.72%