84% attachment-page-redirect-x

Code Review | Attachment Page Redirect X

WordPress plugin Attachment Page Redirect X scored 84% from 54 tests.

About plugin

  • Plugin page: attachment-page-r...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: Sep 6, 2013
  • Latest release: May 17, 2014
  • Number of updates: 9
  • Update frequency: every 32.0 days
  • Top authors: Beej (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,502 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Attachment Page Redirect X
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.70 ▼3.08
Dashboard /wp-admin3.31 ▲0.0044.54 ▼2.63
Posts /wp-admin/edit.php3.36 ▲0.0042.58 ▼3.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.21 ▼2.43
Media Library /wp-admin/upload.php3.23 ▲0.0053.18 ▲20.68

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Attachment Page Redirect X: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.27 ▼1.114.87 ▲2.9542.75 ▲0.83
Dashboard /wp-admin2,206 ▲185.91 ▲0.83102.00 ▼10.8839.44 ▼2.84
Posts /wp-admin/edit.php2,089 ▼32.04 ▼0.1436.39 ▼3.9933.61 ▼2.10
Add New Post /wp-admin/post-new.php1,523 ▼1123.26 ▲0.01625.46 ▼20.3956.89 ▼0.57
Media Library /wp-admin/upload.php1,385 ▼64.18 ▲0.00109.52 ▲12.3450.08 ▲3.14

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 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 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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/attachment-page-redirect-x/attachment-page-redirect-x.php:48

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: pages, attachments, redirects

attachment-page-redirect-x/attachment-page-redirect-x.php Passed 13 tests

"Attachment Page Redirect X" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
107 characters long description:
Redirect attachment pages to their parent page (301), when possible, otherwise to the blog home page (302).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected42 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12742

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.56
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 files were detected