83% simple-ads-txt

Code Review | Simple ads.txt

WordPress plugin Simple ads.txt scored 83% from 54 tests.

About plugin

  • Plugin page: simple-ads-txt
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 26, 2017
  • Latest release: Dec 26, 2017
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: vahanpetrosyan (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active / 32,910 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.02MB] [CPU: ▼6.97ms] Passed 4 tests

An overview of server-side resources used by Simple ads.txt
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.51 ▼9.37
Dashboard /wp-admin3.33 ▲0.0245.35 ▼0.44
Posts /wp-admin/edit.php3.38 ▲0.0248.32 ▼6.22
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.35 ▼10.97
Media Library /wp-admin/upload.php3.25 ▲0.0235.46 ▼1.33
ads.txt editor /wp-admin/options-general.php?page=bs_ads_txt_settings3.2230.77

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Simple ads.txt
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.26 ▼1.301.80 ▼0.0845.51 ▲3.46
Dashboard /wp-admin2,213 ▲285.86 ▲0.0598.97 ▼12.2140.00 ▼5.62
Posts /wp-admin/edit.php2,093 ▲12.04 ▼0.0140.42 ▲0.6636.30 ▲1.11
Add New Post /wp-admin/post-new.php1,545 ▲17918.67 ▲0.83646.20 ▼8.8458.17 ▲9.66
Media Library /wp-admin/upload.php1,395 ▲74.21 ▲0.06104.09 ▼4.5745.32 ▼3.73
ads.txt editor /wp-admin/options-general.php?page=bs_ads_txt_settings8022.0528.4326.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 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 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 items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-ads-txt/bs_ads_txt.class.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/simple-ads-txt/templates/settings_page.php:5

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 83% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Requires php: Version not formatted correctly
  • Requires at least: Version not formatted correctly
  • Contributors: Plugin contributors field is missing
You can take inspiration from this readme.txt

simple-ads-txt/bs_ads_txt.php 85% from 13 tests

The main file in "Simple ads.txt" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-ads-txt.php" instead of "bs_ads_txt.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected92 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3145692

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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
No PNG images were found in this plugin