83% db-robotstxt

Code Review | DB Robots.txt

WordPress plugin DB Robots.txt scored83%from 54 tests.

About plugin

  • Plugin page: db-robotstxt
  • Plugin version: 3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Dec 1, 2016
  • Latest release: Sep 16, 2023
  • Number of updates: 24
  • Update frequency: every 103.1 days
  • Top authors: bisteinoff (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /5,031 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.04MB] [CPU: ▼2.38ms] Passed 4 tests

Server-side resources used by DB Robots.txt
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0641.37 ▲0.30
Dashboard /wp-admin3.35 ▲0.0450.66 ▲1.74
Posts /wp-admin/edit.php3.40 ▲0.0450.41 ▲0.16
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.78 ▼10.61
Media Library /wp-admin/upload.php3.27 ▲0.0438.15 ▲0.65
DB Robots.txt /wp-admin/options-general.php?page=db-robotstxt3.2931.39

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 11 new options
New WordPress options
db_robots_custom_other
db_robots_custom_yandex
db_robots_custom
widget_theysaidso_widget
db_upgraded
db_robots_if_yandex
db_robots_custom_google
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for DB Robots.txt
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.23 ▼0.191.83 ▼0.2940.52 ▼2.52
Dashboard /wp-admin2,201 ▲305.57 ▼0.0891.30 ▼0.0141.44 ▲0.24
Posts /wp-admin/edit.php2,106 ▲61.99 ▲0.0236.74 ▼0.9132.85 ▼6.15
Add New Post /wp-admin/post-new.php1,531 ▲322.93 ▲1.80705.91 ▲19.5760.48 ▲6.76
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.05102.24 ▼3.6441.86 ▼3.48
DB Robots.txt /wp-admin/options-general.php?page=db-robotstxt1,0661.9923.2740.39

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_recent-comments
    • db_upgraded
    • db_robots_custom_other
    • theysaidso_admin_options
    • db_robots_custom_yandex
    • widget_recent-posts
    • db_robots_if_yandex
    • widget_theysaidso_widget
    • db_robots_custom
    • db_robots_custom_google
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=db-robotstxt
    • > Notice in wp-content/plugins/db-robotstxt/inc/settings.php+111
    Undefined variable: db_renamed
    • > GET request to /wp-admin/options-general.php?page=db-robotstxt
    • > Notice in wp-content/plugins/db-robotstxt/inc/settings.php+124
    Undefined variable: db_deleted

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% 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 require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

db-robotstxt/bisteinoff-robots-txt.php 85% from 13 tests

"DB Robots.txt" version 3.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("db-robotstxt.php" instead of "bisteinoff-robots-txt.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 246 characters long)

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
Success! There were no dangerous files found in this plugin531 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP213235438
CSS219193

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
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
No PNG files were detected