72% htaccess-file-editor

Code Review | Htaccess File Editor - Easily Edit, Backup, Restore .htaccess file

WordPress plugin Htaccess File Editor - Easily Edit, Backup, Restore .htaccess file scored72%from 54 tests.

About plugin

  • Plugin page: htaccess-file-editor
  • Plugin version: 1.0.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 24, 2018
  • Latest release: Jul 22, 2023
  • Number of updates: 24
  • Update frequency: every 82.3 days
  • Top authors: mantrabrain (79.17%)themeegg (25%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /63,469 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.01ms] Passed 4 tests

This is a short check of server-side resources used by Htaccess File Editor - Easily Edit, Backup, Restore .htaccess file
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.62 ▼3.05
Dashboard /wp-admin3.53 ▲0.2299.61 ▲48.37
Posts /wp-admin/edit.php3.54 ▲0.1847.22 ▼3.41
Add New Post /wp-admin/post-new.php6.01 ▲0.1284.85 ▼4.07
Media Library /wp-admin/upload.php3.35 ▲0.1235.03 ▼1.49
Htaccess /wp-admin/admin.php?page=htaccess-file-editor3.3833.29
Backup /wp-admin/admin.php?page=htaccess-file-editor-backup3.3433.83

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

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

Browser metrics Passed 4 tests

Htaccess File Editor - Easily Edit, Backup, Restore .htaccess file: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲21413.18 ▼1.431.95 ▲0.1543.31 ▼1.30
Dashboard /wp-admin2,333 ▲1425.83 ▲0.9499.66 ▼5.5289.62 ▲47.16
Posts /wp-admin/edit.php2,152 ▲632.01 ▼0.0334.78 ▼5.5736.90 ▲0.23
Add New Post /wp-admin/post-new.php1,582 ▲4723.13 ▼0.16730.16 ▲55.1867.37 ▲13.06
Media Library /wp-admin/upload.php1,451 ▲694.23 ▲0.0699.78 ▲2.4972.67 ▲27.27
Htaccess /wp-admin/admin.php?page=htaccess-file-editor1,3423.7273.3039.46
Backup /wp-admin/admin.php?page=htaccess-file-editor-backup8893.6855.5427.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/htaccess-file-editor/templates/backup-page.php
    • > /wp-content/plugins/htaccess-file-editor/templates/dashboard.php
    • > /wp-content/plugins/htaccess-file-editor/includes/functions.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/htaccess-file-editor/templates/notices/backup-success.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/htaccess-file-editor/templates/notices/restore-failed.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/htaccess-file-editor/templates/notices/backup-failed.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/htaccess-file-editor/templates/backup-form.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/htaccess-file-editor/includes/class-htaccess-file-editor-actions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/htaccess-file-editor/includes/class-htaccess-file-editor-hooks.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/htaccess-file-editor/includes/admin/dashboard/class-mantrabrain-admin-dashboard.php:125
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/htaccess-file-editor/templates/notices/delete-failed.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/htaccess-file-editor/templates/notices/delete-success.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/htaccess-file-editor/templates/backup-form.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=htaccess-file-editor-backup
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,hoverIntent,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'value')" "TypeError: Cannot read properties of undefined (reading 'value')\n at Function.fg [as fromTextArea] (/wp-includes/js/codemirror/codemirror.min.js?ver=5.29.1-alpha-ee20357:22:31506)\n at d.codeEditor.initialize (/wp-admin/js/code-editor.min.js?ver=6.3.1:2:1977)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/htaccess-file-editor/assets/js/htaccess-file-editor.js?ver=1.0.16:3:19)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,hoverIntent,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,hoverIntent,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=htaccess-file-editor-backup
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,hoverIntent,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'value')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: htaccess backup, htaccess editor, htaccess restore, htaccess

htaccess-file-editor/htaccess-file-editor.php 92% from 13 tests

The main file in "Htaccess File Editor - Easily Edit, Backup, Restore .htaccess file" v. 1.0.16 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin915 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP17242259909
JavaScript2204
CSS2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.20
▷ Minimum class complexity3.00
▷ Maximum class complexity21.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods34
▷ Static methods38.82%
▷ Public methods2470.59%
▷ Protected methods617.65%
▷ Private methods411.76%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants964.29%
▷ Class constants535.71%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png0.86KB0.81KB▼ 5.45%