10% fraudgrade

Code Review | FraudGrade

WordPress plugin FraudGrade scored10%from 54 tests.

About plugin

  • Plugin page: fraudgrade
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2018
  • Latest release: May 12, 2018
  • Number of updates: 12
  • Update frequency: every 9.8 days
  • Top authors: fraudgrade (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,199 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/fraudgrade/libraries/admin.php+95
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.09MB] [CPU: ▼15.23ms] Passed 4 tests

Server-side resources used by FraudGrade
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1145.01 ▲0.87
Dashboard /wp-admin3.55 ▲0.1639.70 ▼29.44
Posts /wp-admin/edit.php3.61 ▲0.2140.42 ▼10.29
Add New Post /wp-admin/post-new.php5.80 ▼0.1486.72 ▼22.06
Media Library /wp-admin/upload.php3.55 ▲0.2840.47 ▲3.42
IP Review Settings /wp-admin/edit.php?post_type=ip_check&page=ip_check3.5236.03
IP Review Cache /wp-admin/edit.php?post_type=ip_check3.6040.11

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 13 new options
New WordPress options
db_upgraded
recovery_mode_email_last_sent
widget_recent-comments
ipc_settings
theysaidso_admin_options
widget_theysaidso_widget
_ipc_total_nonblocks
_ipc_total_blocks
can_compress_scripts
_ipc_alltime_visits
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for FraudGrade
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,196 ▼57512.26 ▼2.272.03 ▼0.2345.19 ▲1.97
Dashboard /wp-admin1,605 ▼5751.41 ▼4.1615.35 ▼80.5939.93 ▼4.99
Posts /wp-admin/edit.php2,154 ▲542.05 ▲0.0343.46 ▲5.0545.28 ▲8.79
Add New Post /wp-admin/post-new.php1,715 ▲18922.25 ▼0.94701.49 ▲18.3837.20 ▼20.18
Media Library /wp-admin/upload.php1,449 ▲464.21 ▲0.09101.42 ▼3.8744.58 ▼0.77
IP Review Settings /wp-admin/edit.php?post_type=ip_check&page=ip_check2,4511.8335.8332.56
IP Review Cache /wp-admin/edit.php?post_type=ip_check1,2821.9537.8541.91

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • _ipc_alltime_visits
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • _ipc_total_nonblocks
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • _ipc_total_blocks
    • _ipc_whitelisted
    • db_upgraded
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ip_check
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
  • 244 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ip_check&page=ip_check
    • > Warning in wp-content/plugins/fraudgrade/libraries/admin.php+560
    in_array() expects parameter 2 to be array, string given
    • > GET request to /wp-admin/edit.php?post_type=ip_check&page=ip_check
    • > Warning in wp-content/plugins/fraudgrade/libraries/admin.php+410
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/edit.php?post_type=ip_check&page=ip_check
    • > Compile error in wp-content/plugins/fraudgrade/views/widget.php+29
    Cannot declare class ipvl_FraudGrade_Datagrid, because the name is already in use
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ip_check
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ip_check
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Settings) image not found
Please take inspiration from this readme.txt

fraudgrade/fraudgrade.php 77% from 13 tests

The main PHP script in "FraudGrade" version 2.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 240 characters long)
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

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 plugin2,568 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP83097561,670
CSS230509
JavaScript383130389

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity26.67
▷ Minimum class complexity3.00
▷ Maximum class complexity72.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods74
▷ Static methods1013.51%
▷ Public methods74100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
2 PNG files occupy 0.28MB with 0.19MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot1.png234.62KB64.64KB▼ 72.45%
assets/images/flags16.png50.10KB18.91KB▼ 62.26%