74% zotya-htaccess-protect

Code Review | htaccess protect

WordPress plugin htaccess protect scored 74% from 54 tests.

About plugin

  • Plugin page: zotya-htaccess-pr...
  • Plugin version: 0.7.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: May 29, 2020
  • Latest release: Jan 23, 2022
  • Number of updates: 14
  • Update frequency: every 43.2 days
  • Top authors: zoltanlaczko (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 7,898 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.64ms] Passed 4 tests

An overview of server-side resources used by htaccess protect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0941.39 ▼8.37
Dashboard /wp-admin3.40 ▲0.1045.95 ▲0.78
Posts /wp-admin/edit.php3.52 ▲0.1647.94 ▲2.33
Add New Post /wp-admin/post-new.php6.00 ▲0.1185.80 ▼17.29
Media Library /wp-admin/upload.php3.33 ▲0.0937.15 ▲4.66
htaccess protect /wp-admin/options-general.php?page=zotya-htaccess-protect3.2932.32

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
zotya_hp_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for htaccess protect
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.75 ▲0.371.84 ▼0.2144.14 ▼2.30
Dashboard /wp-admin2,214 ▲264.88 ▼1.01102.81 ▼11.1239.96 ▼4.37
Posts /wp-admin/edit.php2,097 ▲52.02 ▲0.0140.98 ▲0.1433.97 ▼3.85
Add New Post /wp-admin/post-new.php1,536 ▲523.46 ▲5.12682.42 ▲72.5050.79 ▼10.08
Media Library /wp-admin/upload.php1,399 ▲114.22 ▼0.0398.77 ▲0.8343.91 ▼1.85
htaccess protect /wp-admin/options-general.php?page=zotya-htaccess-protect9691.8524.2030.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/zotya-htaccess-protect/class.htaccess.php+367
    file_get_contents(wp-admin/.htaccess): failed to open stream: No such file or directory
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zotya-htaccess-protect/settings-page.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zotya-htaccess-protect/settings-page.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
7 plugin tags: protection, htaccess, security, wp-login, htpasswd...

zotya-htaccess-protect/zotya-htaccess-protect.php Passed 13 tests

This is the main PHP file of "htaccess protect" version 0.7.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
48 characters long description:
Protect your login or admin pages with password.

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
Everything looks great! No dangerous files found in this plugin622 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP453165421
PO File13840101
CSS112077
Markdown18018
JavaScript1005

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity65.00
▷ Minimum class complexity65.00
▷ Maximum class complexity65.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin