94% affiliate-fraud-shield

Code Review | AFS Loader

WordPress plugin AFS Loader scored 94% from 54 tests.

About plugin

  • Plugin page: affiliate-fraud-s...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6
  • WordPress version: 5.9.2
  • First release: Nov 15, 2016
  • Latest release: Nov 16, 2016
  • Number of updates: 25
  • Update frequency: N/A
  • Top authors: globalrisk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 623 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by AFS Loader
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0253.99 ▲4.76
Dashboard /wp-admin3.42 ▲0.0232.53 ▼0.26
Posts /wp-admin/edit.php3.65 ▲0.0239.53 ▲3.87
Add New Post /wp-admin/post-new.php6.90 ▼0.0795.13 ▼1,191.16
Media Library /wp-admin/upload.php3.31 ▲0.0128.01 ▲0.87

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for AFS Loader
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,815 ▲6115.92 ▲0.395.68 ▼0.432.53 ▼0.15
Dashboard /wp-admin2,907 ▲466.13 ▼0.04113.22 ▼20.55154.54 ▼3.96
Posts /wp-admin/edit.php2,706 ▲123.24 ▲0.0062.91 ▼0.35142.16 ▲6.45
Add New Post /wp-admin/post-new.php1,721 ▲5321.42 ▲3.53449.75 ▲48.51158.49 ▲4.43
Media Library /wp-admin/upload.php1,713 ▲185.53 ▼0.05134.77 ▲4.85182.35 ▼3.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliate-fraud-shield/afs-loader.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliate-fraud-shield/trunk/afs-loader.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === affiliate-fraud-shield === )
You can take inspiration from this readme.txt

affiliate-fraud-shield/afs-loader.php 92% from 13 tests

This is the main PHP file of "AFS Loader" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("affiliate-fraud-shield.php" instead of "afs-loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin74 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1161274

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.20
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%
Functions8
▷ Named functions8100.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
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
assets/screenshot-1.png22.78KB10.98KB▼ 51.81%