84% pc-robotstxt

Code Review | Virtual Robots.txt

WordPress plugin Virtual Robots.txt scored84%from 54 tests.

About plugin

  • Plugin page: pc-robotstxt
  • Plugin version: 1.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 13, 2009
  • Latest release: Jul 22, 2023
  • Number of updates: 52
  • Update frequency: every 99.2 days
  • Top authors: Marios Alexandrou (57.69%)petercoughlin (44.23%)

Code review

54 tests

User reviews

9 reviews

Install metrics

40,000+ active /383,965 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.03MB] [CPU: ▼6.27ms] Passed 4 tests

This is a short check of server-side resources used by Virtual Robots.txt
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.96 ▼11.44
Dashboard /wp-admin3.34 ▲0.0351.66 ▼3.24
Posts /wp-admin/edit.php3.39 ▲0.0352.35 ▲0.41
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.95 ▼10.81
Media Library /wp-admin/upload.php3.26 ▲0.0338.12 ▲2.28
Virtual Robots.txt /wp-admin/options-general.php?page=pc-robotstxt/admin.php3.2234.42

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Virtual Robots.txt
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.68 ▲0.251.75 ▼0.5044.47 ▼1.14
Dashboard /wp-admin2,199 ▲195.61 ▼0.0388.69 ▼2.9037.33 ▼3.67
Posts /wp-admin/edit.php2,107 ▲71.97 ▼0.0434.18 ▼2.4835.75 ▼0.48
Add New Post /wp-admin/post-new.php1,536 ▲823.15 ▲0.08681.12 ▼13.8951.06 ▼17.23
Media Library /wp-admin/upload.php1,407 ▲74.24 ▲0.0295.95 ▼13.7944.84 ▼1.53
Virtual Robots.txt /wp-admin/options-general.php?page=pc-robotstxt/admin.php7982.0023.1530.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • pc_robotstxt
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pc-robotstxt/admin.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pc-robotstxt/pc-robotstxt.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pc-robotstxt/pc-robotstxt.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: robots, robotstxt, robot, crawler

pc-robotstxt/pc-robotstxt.php Passed 13 tests

The main PHP script in "Virtual Robots.txt" version 1.10 is automatically included on every request by WordPress
62 characters long description:
Automatically creates a virtual robots.txt file for your site.

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 detected123 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24541123

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity13.50
▷ Minimum class complexity10.00
▷ Maximum class complexity17.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected