74% robotstxt-rewrite

Code Review | Robots.txt rewrite

WordPress plugin Robots.txt rewrite scored74%from 54 tests.

About plugin

  • Plugin page: robotstxt-rewrite
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.2
  • WordPress version: 6.3.1
  • First release: May 3, 2016
  • Latest release: Feb 21, 2017
  • Number of updates: 22
  • Update frequency: every 13.4 days
  • Top authors: eugenbobrowski (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /33,299 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.90MB] [CPU: ▼30.65ms] Passed 4 tests

This is a short check of server-side resources used by Robots.txt rewrite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.02 ▼9.76
Dashboard /wp-admin3.05 ▼0.3025.01 ▼33.98
Posts /wp-admin/edit.php3.05 ▼0.3123.03 ▼24.80
Add New Post /wp-admin/post-new.php3.05 ▼2.8427.71 ▼54.07
Media Library /wp-admin/upload.php3.05 ▼0.1823.40 ▼8.38
Robots.txt Options /wp-admin/options-general.php?page=robots-txt-options3.3841.83

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Robots.txt rewrite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲2214.04 ▼0.701.60 ▼0.3243.10 ▼6.44
Dashboard /wp-admin2,202 ▲285.65 ▲0.0688.77 ▼1.2144.02 ▲4.00
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0535.63 ▼2.9135.58 ▼0.48
Add New Post /wp-admin/post-new.php1,529 ▼023.53 ▲0.16676.73 ▼4.9954.63 ▼3.18
Media Library /wp-admin/upload.php1,401 ▲74.28 ▲0.0695.86 ▼8.2740.92 ▼38.32
Robots.txt Options /wp-admin/options-general.php?page=robots-txt-options1,2983.8070.3649.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/robotstxt-rewrite/robotstxt-rewrite-admin.php+43
    strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/robotstxt-rewrite/robotstxt-rewrite-admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/robotstxt-rewrite/robotstxt-rewrite.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Robots.txt Options page), #2 (robots.txt)
Please take inspiration from this readme.txt

robotstxt-rewrite/robotstxt-rewrite.php 92% from 13 tests

The main PHP file in "Robots.txt rewrite" ver. 1.6.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 301 characters long)

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
There were no executable files found in this plugin6,226 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
LESS44942662,749
CSS121112,257
PHP322197887
JavaScript36817229
Markdown114088
JSON10016

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity39.33
▷ Minimum class complexity14.00
▷ Maximum class complexity75.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods40
▷ Static methods3177.50%
▷ Public methods3895.00%
▷ Protected methods00.00%
▷ Private methods25.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
atf-fields/assets/chosen-sprite@2x.png0.72KB0.83KB0.00%
screenshot-1.png59.75KB21.64KB▼ 63.77%
atf-fields/assets/blank-1.png0.90KB0.09KB▼ 89.72%
atf-fields/assets/blank.png1.40KB1.15KB▼ 17.86%
atf-fields/assets/chosen-sprite.png0.53KB0.88KB0.00%