84% simple-htaccess-redirects

Code Review | Simple Htaccess Redirects

WordPress plugin Simple Htaccess Redirects scored84%from 54 tests.

About plugin

  • Plugin page: simple-htaccess-r...
  • Plugin version: 1.5.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Jan 14, 2019
  • Latest release: Sep 5, 2019
  • Number of updates: 50
  • Update frequency: every 4.9 days
  • Top authors: mike314156 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,632 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.16MB] [CPU: ▲1.43ms] Passed 4 tests

Analyzing server-side resources used by Simple Htaccess Redirects
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1539.45 ▲1.47
Dashboard /wp-admin3.46 ▲0.1646.99 ▲2.08
Posts /wp-admin/edit.php3.58 ▲0.2243.85 ▲0.21
Add New Post /wp-admin/post-new.php6.04 ▲0.1582.78 ▲2.92
Media Library /wp-admin/upload.php3.38 ▲0.1636.37 ▲1.97
Redirect Settings /wp-admin/options-general.php?page=PK-redirect-settings3.6845.34

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 11 new options
New WordPress options
_PK_created_default
_PK_css_options
_PK_js_options
theysaidso_admin_options
_PK_jpg_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
_PK_png_options
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Htaccess Redirects
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.44 ▲0.051.80 ▼0.3441.47 ▼3.74
Dashboard /wp-admin2,212 ▲335.80 ▲0.92100.82 ▲0.4440.34 ▼6.40
Posts /wp-admin/edit.php2,098 ▲92.07 ▲0.0234.97 ▲2.2830.23 ▼5.85
Add New Post /wp-admin/post-new.php1,536 ▲323.19 ▲0.02672.79 ▼8.2363.78 ▲7.75
Media Library /wp-admin/upload.php1,397 ▲124.25 ▲0.0193.99 ▼8.4740.97 ▼4.04
Redirect Settings /wp-admin/options-general.php?page=PK-redirect-settings2,1531.8829.3165.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 18 options in the database
    • _PK_png_options
    • _PK_jpg_options
    • widget_recent-comments
    • _PK_500_setting
    • _PK_js_options
    • widget_theysaidso_widget
    • _PK_400_setting
    • _PK_301_new_setting
    • _PK_301_old_setting
    • _PK_css_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, 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
Please take a closer look at the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/simple-htaccess-redirects/parts/content-expired-headers.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/simple-htaccess-redirects/parts/content-scan-urls.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-htaccess-redirects/parts/content-404-captures.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-htaccess-redirects/parts/content-active-redirects.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/simple-htaccess-redirects/parts/content-redirect.php:3

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: The official readme.txt is a good inspiration

simple-htaccess-redirects/plugin.php 92% from 13 tests

The main file in "Simple Htaccess Redirects" v. 1.5.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-htaccess-redirects.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,101 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6688922,101

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods315.79%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 images were found in this plugin