89% redirect-attachment-pages

Code Review | Redirect attachment pages for WordPress

WordPress plugin Redirect attachment pages for WordPress scored 89% from 54 tests.

About plugin

  • Plugin page: redirect-attachme...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Dec 18, 2017
  • Latest release: Aug 7, 2023
  • Number of updates: 11
  • Update frequency: every 187.0 days
  • Top authors: code4life (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,121 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.28ms] Passed 4 tests

Server-side resources used by Redirect attachment pages for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.35 ▼5.41
Dashboard /wp-admin3.32 ▲0.0145.29 ▼3.65
Posts /wp-admin/edit.php3.37 ▲0.0147.77 ▼3.22
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.53 ▲1.27
Media Library /wp-admin/upload.php3.24 ▲0.0133.91 ▼0.84

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Redirect attachment pages for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.67 ▼0.981.57 ▼0.1038.44 ▼2.94
Dashboard /wp-admin2,209 ▲184.83 ▼1.05108.43 ▲10.2641.50 ▼5.17
Posts /wp-admin/edit.php2,092 ▲62.01 ▼0.0440.28 ▼0.6336.96 ▼2.40
Add New Post /wp-admin/post-new.php1,539 ▲1123.12 ▼0.06627.29 ▼54.5245.08 ▼10.32
Media Library /wp-admin/upload.php1,382 ▼64.18 ▼0.0395.19 ▼7.5942.61 ▼6.05

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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 SRP test was a success

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: prevent indexing, images, attachments, indexing, attachment...

redirect-attachment-pages/redirect-attachment-pages-for-wp.php 85% from 13 tests

"Redirect attachment pages for WordPress" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("redirect-attachment-pages.php" instead of "redirect-attachment-pages-for-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin23 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP261723

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin