90% snack-ads-txt

Code Review | Snack Ads.txt

WordPress plugin Snack Ads.txt scored90%from 54 tests.

About plugin

  • Plugin page: snack-ads-txt
  • Plugin version: 3.0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Jan 3, 2020
  • Latest release: Aug 22, 2023
  • Number of updates: 28
  • Update frequency: every 47.4 days
  • Top authors: bouk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,610 total downloads

Benchmarks

Plugin footprint 83% from 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.00MB] [CPU: ▼12.23ms] Passed 4 tests

A check of server-side resources used by Snack Ads.txt
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.19 ▼9.25
Dashboard /wp-admin3.32 ▼0.0342.93 ▼16.24
Posts /wp-admin/edit.php3.37 ▲0.0145.07 ▼4.66
Add New Post /wp-admin/post-new.php5.90 ▲0.0282.06 ▼18.78
Media Library /wp-admin/upload.php3.24 ▲0.0131.58 ▼3.60

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Snack Ads.txt
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.30 ▼0.971.68 ▲0.0141.20 ▼1.93
Dashboard /wp-admin2,203 ▲115.86 ▲0.92103.82 ▼6.1541.95 ▼1.94
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0634.50 ▲0.2335.14 ▼0.87
Add New Post /wp-admin/post-new.php1,514 ▼1417.68 ▼0.66671.46 ▼31.3160.31 ▲8.05
Media Library /wp-admin/upload.php1,388 ▲64.21 ▼0.0196.49 ▼1.8943.98 ▲0.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

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
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

snack-ads-txt/snack-ads-txt.php Passed 13 tests

The main file in "Snack Ads.txt" v. 3.0.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
54 characters long description:
Handles automatic creation and updates of ads.txt file

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected515 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP11130272515

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.83
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods3397.06%
▷ Protected methods00.00%
▷ Private methods12.94%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin