74% groups-404-redirect

Code Review | Groups 404 Redirect

WordPress plugin Groups 404 Redirect scored74%from 54 tests.

About plugin

  • Plugin page: groups-404-redirect
  • Plugin version: 1.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 10, 2013
  • Latest release: Apr 27, 2023
  • Number of updates: 43
  • Update frequency: every 87.4 days
  • Top authors: itthinx (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /31,598 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.89MB] [CPU: ▼39.05ms] Passed 4 tests

Analyzing server-side resources used by Groups 404 Redirect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0647.34 ▼0.26
Dashboard /wp-admin3.06 ▼0.2525.72 ▼28.84
Posts /wp-admin/edit.php3.06 ▼0.3025.92 ▼28.76
Add New Post /wp-admin/post-new.php3.06 ▼2.8325.11 ▼82.68
Media Library /wp-admin/upload.php3.06 ▼0.1722.72 ▼15.92

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Groups 404 Redirect: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▲0.061.72 ▼0.0639.23 ▼6.25
Dashboard /wp-admin2,189 ▲185.59 ▼0.0097.15 ▼9.1942.90 ▼2.33
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0136.34 ▼3.9233.20 ▼4.04
Add New Post /wp-admin/post-new.php1,526 ▼523.67 ▲0.58687.95 ▲18.4559.88 ▼1.70
Media Library /wp-admin/upload.php1,397 ▼34.19 ▼0.02100.07 ▼5.7842.00 ▼4.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/groups-404-redirect/groups-404-redirect.php+73
    Use of undefined constant GROUPS_PLUGIN_DOMAIN - assumed 'GROUPS_PLUGIN_DOMAIN' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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
Even though no errors were found, 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/groups-404-redirect/groups-404-redirect.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: access, access control, members, groups, memberships

groups-404-redirect/groups-404-redirect.php Passed 13 tests

"Groups 404 Redirect" version 1.8.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
73 characters long description:
Redirect 404's when a visitor tries to access a page protected by Groups.

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 detected388 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP286124388

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity53.00
▷ Minimum class complexity53.00
▷ Maximum class complexity53.00
Average method complexity7.50
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods8100.00%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.06MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png65.74KB19.49KB▼ 70.36%