10% ads-txt-manager

Code Review | Ads.txt Manager

WordPress plugin Ads.txt Manager scored10%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: 6.3.1
  • 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

2 reviews

Install metrics

8,000+ active /64,437 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > 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: ▼1.83MB] [CPU: ▼49.22ms] Passed 4 tests

Analyzing server-side resources used by Ads.txt Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.69 ▼34.66
Dashboard /wp-admin2.18 ▼1.137.29 ▼47.65
Posts /wp-admin/edit.php2.18 ▼1.186.94 ▼38.19
Add New Post /wp-admin/post-new.php2.18 ▼3.718.78 ▼76.38
Media Library /wp-admin/upload.php2.18 ▼1.057.42 ▼28.98
Ads.txt Manager Settings /wp-admin/options-general.php?page=adstxtmanager-setting-admin2.188.74

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Ads.txt Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.33 ▼1.071.70 ▼0.1342.54 ▼5.51
Dashboard /wp-admin2,212 ▲214.86 ▼0.08109.43 ▲4.1541.04 ▲1.59
Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0239.36 ▲0.0735.77 ▲0.84
Add New Post /wp-admin/post-new.php1,542 ▲2818.21 ▲0.77620.66 ▼56.4455.04 ▼17.34
Media Library /wp-admin/upload.php1,394 ▲64.26 ▲0.0692.82 ▼5.4340.63 ▼2.65
Ads.txt Manager Settings /wp-admin/options-general.php?page=adstxtmanager-setting-admin7922.0327.3937.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > 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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 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 | 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ads-txt-manager/admin/partials/adstxtmanager-admin-display.php
  • 10× PHP files trigger server errors when accessed directly:
    • > 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: Interface 'iAdsTxtManager_Solution' not found in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-htaccess-modifier.php:3
    • > 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: 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: Interface 'iAdsTxtManager_Solution' not found in wp-content/plugins/ads-txt-manager/includes/class-adstxtmanager-empty-solution.php:3
    • > 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-solution-factory.php:8
    • > 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 39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: ads txt, publishers, ezoic, adstxt, ad manager...

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

The main file in "Ads.txt Manager" v. 1.0.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ads-txt-manager.php" instead of "adstxtmanager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were 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

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin