94% adstxt

Code Review | adstxt Plugin

WordPress plugin adstxt Plugin scored 94% from 54 tests.

About plugin

  • Plugin page: adstxt
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Aug 4, 2021
  • Latest release: Jan 28, 2022
  • Number of updates: 3
  • Update frequency: every 59.0 days
  • Top authors: vbondarenko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 198 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼294.65ms] Passed 4 tests

This is a short check of server-side resources used by adstxt Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0174.99 ▲23.35
Dashboard /wp-admin3.41 ▲0.0133.62 ▼5.77
Posts /wp-admin/edit.php3.65 ▲0.0137.11 ▼0.10
Add New Post /wp-admin/post-new.php6.88 ▼0.08101.35 ▼1,170.42
Media Library /wp-admin/upload.php3.30 ▲0.0025.23 ▼2.32

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

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

Browser metrics Passed 4 tests

A check of browser resources used by adstxt Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4615.58 ▼0.176.20 ▼1.942.51 ▲0.08
Dashboard /wp-admin2,898 ▲376.13 ▼0.02119.46 ▼27.45173.37 ▲10.84
Posts /wp-admin/edit.php2,708 ▲173.24 ▼0.0165.64 ▼0.21135.09 ▼48.14
Add New Post /wp-admin/post-new.php1,674 ▼2216.68 ▼1.45408.53 ▼37.58181.54 ▲5.16
Media Library /wp-admin/upload.php1,718 ▲205.50 ▲0.02138.67 ▼0.32193.45 ▲0.89

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 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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 fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url_raw() in wp-content/plugins/adstxt/adstxt.php:11

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Requires php: Version format is invalid
The official readme.txt is a good inspiration

adstxt/adstxt.php Passed 13 tests

The primary PHP file in "adstxt Plugin" version 1.0.0 is used by WordPress to initiate all plugin functionality
74 characters long description:
Manage your ads.txt from within Wordpress and save as file to uploads dir.

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 detected49 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2131439
Markdown14010

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.21
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.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%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
PNG images were not found in this plugin