84% change-media-parent

Code Review | Change Media Parent

WordPress plugin Change Media Parent scored84%from 54 tests.

About plugin

  • Plugin page: change-media-parent
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.3
  • WordPress version: 6.3.1
  • First release: Sep 22, 2012
  • Latest release: Aug 2, 2015
  • Number of updates: 4
  • Update frequency: every 265.8 days
  • Top authors: pantsonhead (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,239 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
Installer ran successfully

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

Server-side resources used by Change Media Parent
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.89 ▼1.54
Dashboard /wp-admin3.31 ▼0.0343.53 ▼11.86
Posts /wp-admin/edit.php3.36 ▲0.0143.94 ▼3.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0179.75 ▼20.84
Media Library /wp-admin/upload.php3.23 ▲0.0034.27 ▼0.29

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Change Media Parent
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼1.321.71 ▼0.0845.18 ▲1.35
Dashboard /wp-admin2,203 ▲185.78 ▼0.1296.07 ▼2.8637.56 ▼5.71
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0638.20 ▼1.3935.13 ▲0.06
Add New Post /wp-admin/post-new.php1,529 ▼423.52 ▲0.56668.03 ▲2.4157.88 ▼2.95
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0297.53 ▼2.6639.57 ▼8.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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/change-media-parent/change_media_parent.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Link and Post Selection window) image not found
The official readme.txt is a good inspiration

change-media-parent/change_media_parent.php 92% from 13 tests

The principal PHP file in "Change Media Parent" v. 0.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("change-media-parent.php" instead of "change_media_parent.php")

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
No dangerous file extensions were detected10 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1112410

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.67
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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png82.42KB27.83KB▼ 66.23%