94% ads-txt-lab

Code Review | ads.txt lab

WordPress plugin ads.txt lab scored 94% from 54 tests.

About plugin

  • Plugin page: ads-txt-lab
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 5.9.2
  • First release: Oct 28, 2017
  • Latest release: Oct 28, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: adstxtlab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,136 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by ads.txt lab
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0257.74 ▲1.48
Dashboard /wp-admin3.42 ▲0.0251.41 ▼19.48
Posts /wp-admin/edit.php3.66 ▲0.0239.48 ▲2.81
Add New Post /wp-admin/post-new.php6.90 ▼0.0795.38 ▼1,186.06
Media Library /wp-admin/upload.php3.31 ▲0.0248.30 ▲24.10
ads.txt lab /wp-admin/options-general.php?page=ads_txt_lab_admin3.2821.82

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

ads.txt lab: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4615.92 ▲0.325.74 ▼0.192.33 ▼0.05
Dashboard /wp-admin2,897 ▲446.14 ▲0.01120.10 ▼4.32160.66 ▼1.70
Posts /wp-admin/edit.php2,691 ▼03.26 ▲0.0366.68 ▼46.92204.25 ▲52.56
Add New Post /wp-admin/post-new.php1,701 ▲4122.01 ▲5.80437.95 ▲13.63161.61 ▲2.77
Media Library /wp-admin/upload.php1,703 ▲85.52 ▲0.01159.96 ▲10.97191.62 ▼32.20
ads.txt lab /wp-admin/options-general.php?page=ads_txt_lab_admin1,0022.3953.83158.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ads-txt-lab/adstxtlab.php
    • > /wp-content/plugins/ads-txt-lab/views/admin.php

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: iab, adstxt, banner, advertising

ads-txt-lab/adstxtlab.php 85% from 13 tests

The entry point to "ads.txt lab" version 1.5 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 325 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("ads-txt-lab.php" instead of "adstxtlab.php")

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
There were no executable files found in this plugin161 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33027161

PHP code Passed 2 tests

An short overview of 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.37
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods480.00%
▷ Protected methods00.00%
▷ Private methods120.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin