10% trafficguard

Code Review | TrafficGuard PPC Fraud Prevention

WordPress plugin TrafficGuard PPC Fraud Prevention scored10%from 54 tests.

About plugin

  • Plugin page: trafficguard
  • Plugin version: 1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 6.3.1
  • First release: May 22, 2019
  • Latest release: Oct 29, 2021
  • Number of updates: 36
  • Update frequency: every 26.2 days
  • Top authors: trafficguard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,521 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
  • The plugin did not install without errors
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.89ms] Passed 4 tests

This is a short check of server-side resources used by TrafficGuard PPC Fraud Prevention
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0944.57 ▲6.69
Dashboard /wp-admin3.38 ▲0.0845.61 ▼4.52
Posts /wp-admin/edit.php3.50 ▲0.1447.50 ▼10.49
Add New Post /wp-admin/post-new.php5.96 ▲0.0892.01 ▼2.97
Media Library /wp-admin/upload.php3.31 ▲0.0835.43 ▼1.58

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for TrafficGuard PPC Fraud Prevention
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9014.60 ▲0.222.21 ▲0.4545.42 ▲2.24
Dashboard /wp-admin2,214 ▲265.88 ▲1.00102.49 ▼9.0374.32 ▲28.52
Posts /wp-admin/edit.php2,106 ▲172.00 ▲0.0039.34 ▼0.7432.91 ▼6.78
Add New Post /wp-admin/post-new.php1,528 ▼523.20 ▼0.05676.33 ▼2.0064.26 ▲0.75
Media Library /wp-admin/upload.php1,393 ▲114.20 ▼0.01103.30 ▲0.9543.83 ▼0.24

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/trafficguard/resources/admin/settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/trafficguard/trafficguard-runtime-config.php:7
    • > PHP Warning
      Use of undefined constant TRAFFICGUARD_PLUGIN_SLUG__ - assumed 'TRAFFICGUARD_PLUGIN_SLUG__' (this will throw an Error in a future version of PHP) in wp-content/plugins/trafficguard/resources/admin/settings.php on line 12
    • > PHP Notice
      Undefined variable: alert_type in wp-content/plugins/trafficguard/resources/views/system_notification.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/trafficguard/trafficguard-runtime-config.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can take inspiration from this readme.txt

trafficguard/trafficguard.php Passed 13 tests

The entry point to "TrafficGuard PPC Fraud Prevention" version 1.9 is a PHP file that has certain tags in its header comment area
41 characters long description:
TrafficGuard Service plugin for Wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected514 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP893135416
CSS113198

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.24
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods33
▷ Static methods1957.58%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants2275.86%
▷ Class constants724.14%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/tg_settings_logo.png11.54KB6.63KB▼ 42.58%
resources/images/tg_properties_hi.png17.23KB7.25KB▼ 57.92%
resources/images/favicon.png0.50KB0.57KB0.00%