88% adservice-affiliate-network-tracking

Code Review | Adservice - Affiliate Network

WordPress plugin Adservice - Affiliate Network scored 88% from 54 tests.

About plugin

  • Plugin page: adservice-affilia...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 5.9.2
  • First release: Feb 22, 2022
  • Latest release: Mar 9, 2022
  • Number of updates: 14
  • Update frequency: every 1.4 days
  • Top authors: adserviceplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 92 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼297.95ms] Passed 4 tests

A check of server-side resources used by Adservice - Affiliate Network
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1452.66 ▲1.42
Dashboard /wp-admin3.49 ▲0.0933.88 ▼11.19
Posts /wp-admin/edit.php3.72 ▲0.0838.57 ▲0.28
Add New Post /wp-admin/post-new.php6.99 ▼0.0195.03 ▼1,182.30
Media Library /wp-admin/upload.php3.37 ▲0.0825.54 ▲1.68

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Adservice - Affiliate Network
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,856 ▲10216.19 ▲0.206.63 ▲0.753.09 ▲0.29
Dashboard /wp-admin2,947 ▲866.23 ▼0.09119.20 ▼15.51136.25 ▼21.20
Posts /wp-admin/edit.php2,743 ▲523.25 ▲0.0164.92 ▼0.12117.21 ▼30.79
Add New Post /wp-admin/post-new.php1,688 ▲2721.20 ▲5.11426.87 ▲17.66183.84 ▲27.39
Media Library /wp-admin/upload.php1,754 ▲625.54 ▲0.01149.20 ▲15.10203.92 ▲23.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/adservice-affiliate-network-tracking/admin/partials/astrk-admin-display.php
    • > /wp-content/plugins/adservice-affiliate-network-tracking/public/partials/astrk-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/adservice-affiliate-network-tracking/index.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found


Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: tracking, marketing, affiliate, conversion, adservice...

adservice-affiliate-network-tracking/astrk.php 77% from 13 tests

The entry point to "Adservice - Affiliate Network" version 1.0.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("adservice-affiliate-network-tracking.php" instead of "astrk.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 218 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,571 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity5.75
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
▷ Static methods517.24%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
▷ Named functions13100.00%
▷ Anonymous functions00.00%
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/info.png15.26KB13.40KB▼ 12.21%
images/logo.png5.18KB2.58KB▼ 50.24%