89% ads-txt-admin

Code Review | Ads.txt Admin

WordPress plugin Ads.txt Admin scored89%from 54 tests.

About plugin

  • Plugin page: ads-txt-admin
  • Plugin version: 1.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.3
  • WordPress version: 6.3.1
  • First release: Feb 9, 2018
  • Latest release: Feb 20, 2019
  • Number of updates: 14
  • Update frequency: every 26.9 days
  • Top authors: dmartuszewskium (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /14,368 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Ads.txt Admin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.70 ▼6.16
Dashboard /wp-admin3.32 ▲0.0244.94 ▼7.36
Posts /wp-admin/edit.php3.37 ▲0.0248.72 ▲1.07
Add New Post /wp-admin/post-new.php5.92 ▲0.0490.49 ▼7.86
Media Library /wp-admin/upload.php3.25 ▲0.0237.13 ▲5.17

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Ads.txt Admin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.41 ▲0.021.68 ▼0.1843.01 ▲0.31
Dashboard /wp-admin2,231 ▲405.88 ▲0.9499.65 ▼0.8785.13 ▲45.62
Posts /wp-admin/edit.php2,114 ▲252.01 ▼0.0434.38 ▼0.8531.92 ▼2.81
Add New Post /wp-admin/post-new.php1,534 ▼1317.67 ▼0.66664.84 ▲39.1754.39 ▼11.61
Media Library /wp-admin/upload.php1,410 ▲254.16 ▼0.1394.46 ▼2.3479.08 ▲37.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 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)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: There are too many tags (31 tag instead of maximum 10)
Please take inspiration from this readme.txt

ads-txt-admin/unveil-media-ads-txt.php 85% from 13 tests

"Ads.txt Admin" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ads-txt-admin.php" instead of "unveil-media-ads-txt.php")
  • 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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,270 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS11201771
PHP37615375
JavaScript1220124

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.00
▷ Minimum class complexity4.00
▷ Maximum class complexity10.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods211.11%
▷ Public methods1477.78%
▷ Protected methods422.22%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/um-ads-txt.png11.33KB2.92KB▼ 74.23%
img/um-info.png169.53KB44.43KB▼ 73.79%
img/um-ads-txt-avatar.png2.36KB1.03KB▼ 56.19%