68% better-robots-txt

Code Review | WordPress Robots.txt optimizer (+ XML Sitemap) – Boost SEO, Traffic & Rankings

WordPress plugin WordPress Robots.txt optimizer (+ XML Sitemap) – Boost SEO, Traffic & Rankings scored68%from 54 tests.

About plugin

  • Plugin page: better-robots-txt
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: May 16, 2018
  • Latest release: Sep 12, 2023
  • Number of updates: 132
  • Update frequency: every 14.7 days
  • Top authors: pagup (100%)

Code review

54 tests

User reviews

101 reviews

Install metrics

9,000+ active /250,566 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲5.44MB] [CPU: ▲24.38ms] 75% from 4 tests

Server-side resources used by WordPress Robots.txt optimizer (+ XML Sitemap) – Boost SEO, Traffic & Rankings
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.44MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.27 ▲5.8070.65 ▲31.87
Dashboard /wp-admin9.29 ▲5.9471.97 ▲6.69
Posts /wp-admin/edit.php9.29 ▲5.9381.26 ▲36.08
Add New Post /wp-admin/post-new.php10.00 ▲4.11119.52 ▲22.87
Media Library /wp-admin/upload.php9.29 ▲6.0570.00 ▲37.34
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2958.35

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 323 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
fs_accounts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
fs_debug_mode
robots_txt
can_compress_scripts
fs_active_plugins
db_upgraded

Browser metrics Passed 4 tests

WordPress Robots.txt optimizer (+ XML Sitemap) – Boost SEO, Traffic & Rankings: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲7713.53 ▼0.851.75 ▼0.0338.58 ▼1.42
Dashboard /wp-admin2,248 ▲635.30 ▼0.60121.43 ▲13.9062.23 ▲21.67
Posts /wp-admin/edit.php2,140 ▲482.37 ▲0.3337.15 ▲0.8847.04 ▲11.48
Add New Post /wp-admin/post-new.php1,546 ▲3223.40 ▲5.74706.90 ▲58.6348.31 ▼1.32
Media Library /wp-admin/upload.php1,433 ▲454.54 ▲0.17104.36 ▲3.9755.39 ▲11.97
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1111.9628.7342.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/better-robots-txt/vendor/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • fs_accounts
    • robots_txt
    • fs_debug_mode
    • theysaidso_admin_options
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 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
Please take a closer look at the following
  • 24× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/better-robots-txt/admin/views/steps/step3.view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/better-robots-txt/admin/views/steps/step4.view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/better-robots-txt/admin/views/steps/step6.view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/better-robots-txt/admin/views/steps/step1.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/better-robots-txt/admin/views/steps/step9.view.php:3
    • > PHP Fatal error
      Trait 'Pagup\\BetterRobots\\Traits\\RobotsHelper' not found in wp-content/plugins/better-robots-txt/admin/controllers/RobotsController.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/better-robots-txt/admin/views/inc/top.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/better-robots-txt/admin/views/steps/step2.view.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\BetterRobots\\Controllers\\SettingsController' not found in wp-content/plugins/better-robots-txt/admin/Settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/better-robots-txt/admin/views/steps/step5.view.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: data is not defined" "ReferenceError: data is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/better-robots-txt/admin/assets/app.js?ver=1688856108:75:24)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: data is not defined

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: The official readme.txt might help

better-robots-txt/better-robots-txt.php Passed 13 tests

The principal PHP file in "WordPress Robots.txt optimizer (+ XML Sitemap) – Boost SEO, Traffic & Rankings" v. 1.5.2 is loaded by WordPress automatically on each request
135 characters long description:
Better-Robots.txt plugin helps you boosting your website indexation and your ranking by adding specific instructions in your robots.txt

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin65,526 lines of code in 234 files:
LanguageFilesBlank linesComment linesLines of code
PHP1618,65517,91836,278
PO File229,63711,75425,798
Sass28399772,515
CSS1510117636
JavaScript75276291
JSON1008

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity71.06
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces0
Traits2
Classes63
▷ Abstract classes23.17%
▷ Concrete classes6196.83%
▷ Final classes00.00%
Methods1,348
▷ Static methods22416.62%
▷ Public methods95770.99%
▷ Protected methods171.26%
▷ Private methods37427.74%
Functions105
▷ Named functions10196.19%
▷ Anonymous functions43.81%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
21 PNG files occupy 0.24MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/imgs/star-new4.png8.26KB4.80KB▼ 41.88%
admin/assets/imgs/6.png27.18KB11.65KB▼ 57.15%
admin/assets/imgs/5.png28.95KB8.79KB▼ 69.64%
admin/assets/imgs/star2.png6.66KB4.80KB▼ 27.96%
admin/assets/imgs/p12.png16.41KB7.67KB▼ 53.24%