74% wp-media-replace

Code Review | WP Media Replace

WordPress plugin WP Media Replace scored74%from 54 tests.

About plugin

  • Plugin page: wp-media-replace
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1
  • WordPress version: 6.3.1
  • First release: Apr 29, 2019
  • Latest release: Apr 29, 2019
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: prakashrao (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /1,189 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼11.47ms] Passed 4 tests

Analyzing server-side resources used by WP Media Replace
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0834.04 ▼9.34
Dashboard /wp-admin3.38 ▲0.0344.45 ▼19.25
Posts /wp-admin/edit.php3.49 ▲0.1347.96 ▼5.32
Add New Post /wp-admin/post-new.php5.98 ▲0.0990.02 ▼11.97
Media Library /wp-admin/upload.php3.30 ▲0.0733.89 ▲0.02

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: 1 new table, 6 new options
New tables
wp_media_replace
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Media Replace
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲13013.77 ▼0.617.77 ▲6.0139.39 ▼3.52
Dashboard /wp-admin2,199 ▲84.87 ▼0.94110.05 ▲2.5441.43 ▼2.23
Posts /wp-admin/edit.php2,096 ▲72.30 ▲0.3148.53 ▲10.2537.50 ▲5.52
Add New Post /wp-admin/post-new.php1,508 ▼3017.64 ▼5.47592.03 ▼63.0733.14 ▼19.70
Media Library /wp-admin/upload.php1,388 ▲64.21 ▲0.0299.24 ▲5.6043.31 ▲0.51

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_media_replace
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-media-replace/public/partials/wp-media-replace-public-display.php
    • > /wp-content/plugins/wp-media-replace/admin/partials/wp-media-replace-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: media, replace media, attachment

wp-media-replace/wp-media-replace.php Passed 13 tests

The entry point to "WP Media Replace" version 1.0.0 is a PHP file that has certain tags in its header comment area
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

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
Success! There were no dangerous files found in this plugin391 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12168562368
JavaScript282923
CSS2080

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.18
Average class complexity4.57
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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