10% ads-txt-manager

Code Review | Ads.txt Manager

WordPress plugin Ads.txt Manager scored 10% from 54 tests.

About plugin

  • Plugin page: ads-txt-manager
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 5.9.2
  • First release: Aug 16, 2018
  • Latest release: May 13, 2021
  • Number of updates: 23
  • Update frequency: every 44.0 days
  • Top authors: ezoic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

8,000+ active / 40,394 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-solution-factory.php+19
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼2.47MB] [CPU: ▼348.66ms] Passed 4 tests

A check of server-side resources used by Ads.txt Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.90 ▼1.624.70 ▼46.81
Dashboard /wp-admin1.91 ▼1.494.58 ▼28.63
Posts /wp-admin/edit.php1.92 ▼1.725.61 ▼32.23
Add New Post /wp-admin/post-new.php1.91 ▼5.054.66 ▼1,286.95
Media Library /wp-admin/upload.php1.92 ▼1.384.31 ▼19.84
Ads.txt Manager Settings /wp-admin/options-general.php?page=adstxtmanager-setting-admin1.925.22

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Ads.txt Manager: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲4815.93 ▲0.227.67 ▲1.952.62 ▼0.08
Dashboard /wp-admin2,899 ▲456.15 ▼0.13120.07 ▼13.24154.95 ▼6.82
Posts /wp-admin/edit.php2,698 ▲73.24 ▲0.0064.40 ▼2.62141.53 ▼4.75
Add New Post /wp-admin/post-new.php1,666 ▲517.02 ▼0.27418.73 ▼6.17158.76 ▲1.92
Media Library /wp-admin/upload.php1,708 ▲105.49 ▼0.04135.82 ▼4.91187.33 ▲2.32
Ads.txt Manager Settings /wp-admin/options-general.php?page=adstxtmanager-setting-admin1,0242.4259.30139.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-solution-factory.php+19
    Trying to access array offset on value of type bool

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=adstxtmanager-setting-admin
    • > Notice in wp-content/plugins/ads-txt-manager/admin/class-adstxtmanager-admin.php+67
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ads-txt-manager/admin/partials/adstxtmanager-admin-display.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/ads-txt-manager/admin/partials/adstxtmanager-admin-display.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-activator.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-solution-factory.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'iAdsTxtManager_Solution' not found in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-htaccess-modifier.php:3
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/ads-txt-manager/admin/partials/adstxtmanager-admin-display.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-deactivator.php:23
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/ads-txt-manager/admin/partials/adstxtmanager-admin-display.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'iAdsTxtManager_Solution' not found in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-file-modifier.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'iAdsTxtManager_Solution' not found in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-empty-solution.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
9 plugin tags: ads txt, monetization, adstxt, publishing, ezoic...

ads-txt-manager/adstxtmanager.php 85% from 13 tests

The entry point to "Ads.txt Manager" version 1.0.9 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ads-txt-manager.php" instead of "adstxtmanager.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin606 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP16212547603
CSS12113

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.69
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods51
▷ Static methods35.88%
▷ Public methods4180.39%
▷ Protected methods00.00%
▷ Private methods1019.61%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin