84% attachment-slug

Code Review | Attachment Slugs for WordPress

WordPress plugin Attachment Slugs for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: attachment-slug
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1
  • WordPress version: 6.3.1
  • First release: Feb 27, 2016
  • Latest release: Dec 13, 2022
  • Number of updates: 8
  • Update frequency: every 310.1 days
  • Top authors: sebd86 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /5,217 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.04MB] [CPU: ▼10.76ms] Passed 4 tests

A check of server-side resources used by Attachment Slugs for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.34 ▼4.93
Dashboard /wp-admin3.36 ▲0.0145.26 ▼15.95
Posts /wp-admin/edit.php3.48 ▲0.1253.56 ▲6.42
Add New Post /wp-admin/post-new.php5.95 ▲0.0580.67 ▼22.79
Media Library /wp-admin/upload.php3.29 ▲0.0536.66 ▲0.63

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
attachment_permalink
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Attachment Slugs for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.65 ▲0.111.47 ▼0.4638.80 ▼7.27
Dashboard /wp-admin2,192 ▲155.50 ▼0.0695.79 ▲5.6446.15 ▲6.86
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0738.28 ▲3.1635.36 ▼1.64
Add New Post /wp-admin/post-new.php1,526 ▼223.37 ▲0.31667.54 ▼1.3854.31 ▼9.39
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0496.01 ▼0.8140.98 ▼3.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • attachment_permalink

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/attachment-slug/attachment-slug.php:88

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #2 (Attachment save meta box showing the attachment slug section) image not found
The official readme.txt might help

attachment-slug/attachment-slug.php Passed 13 tests

"Attachment Slugs for WordPress" version 2.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
96 characters long description:
Enables permalink support for media attachments making the URLs more friendly and great for SEO.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected256 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP372231224
PO File16932

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.50
▷ Minimum class complexity7.00
▷ Maximum class complexity14.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods525.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
There were not PNG files found in your plugin