89% upgrade-for-unattach-re-attach-media-attachments

Code Review | Upgrade for Unattach and Re-attach Media Attachments

WordPress plugin Upgrade for Unattach and Re-attach Media Attachments scored89%from 54 tests.

About plugin

  • Plugin page: upgrade-for-unatt...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.0
  • WordPress version: 6.3.1
  • First release: Aug 18, 2017
  • Latest release: Jun 21, 2022
  • Number of updates: 30
  • Update frequency: every 59.0 days
  • Top authors: laurencebahiirwa (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

400+ active /6,304 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

An overview of server-side resources used by Upgrade for Unattach and Re-attach Media Attachments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0047.37 ▲3.85
Dashboard /wp-admin3.31 ▲0.0150.84 ▼0.04
Posts /wp-admin/edit.php3.36 ▲0.0050.99 ▲2.03
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.01 ▼18.79
Media Library /wp-admin/upload.php3.36 ▲0.1441.82 ▲7.36

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Upgrade for Unattach and Re-attach Media Attachments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.61 ▼0.912.11 ▲0.2544.49 ▲0.37
Dashboard /wp-admin2,206 ▲315.85 ▲0.90105.81 ▼14.6041.11 ▼5.62
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0139.98 ▼0.1634.77 ▼4.71
Add New Post /wp-admin/post-new.php1,514 ▼617.57 ▼5.84674.40 ▼21.7855.39 ▼1.90
Media Library /wp-admin/upload.php1,443 ▲524.26 ▲0.0298.75 ▼4.4141.87 ▼0.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

upgrade-for-unattach-re-attach-media-attachments/upgrade-for-unattach-re-attach-media-attachments.php 85% from 13 tests

This is the main PHP file of "Upgrade for Unattach and Re-attach Media Attachments" version 1.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • 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
  • Requires at least: Required version must match the one declared in readme.txt ("4.9.0" instead of "4.9")

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
Everything looks great! No dangerous files found in this plugin223 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP55397173
Markdown117050

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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