67% trash-duplicate-and-301-redirect

Code Review | Trash Duplicate and 301 Redirect

WordPress plugin Trash Duplicate and 301 Redirect scored67%from 54 tests.

About plugin

  • Plugin page: trash-duplicate-a...
  • Plugin version: 1.4.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 9, 2015
  • Latest release: Nov 24, 2023
  • Number of updates: 38
  • Update frequency: every 80.5 days
  • Top authors: solwininfotech (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

4,000+ active /90,949 total downloads

Benchmarks

Plugin footprint 65% 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.05MB] [CPU: ▼25.73ms] 75% from 4 tests

Server-side resources used by Trash Duplicate and 301 Redirect
It is recommended to improve the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 669.91ms on /wp-admin/admin.php?page=about_trash_duplicates)
PageMemory (MB)CPU Time (ms)
Home /2.50 ▼0.9712.04 ▼29.80
Dashboard /wp-admin3.68 ▲0.381,245.16 ▲1,193.36
Posts /wp-admin/edit.php3.80 ▲0.4453.75 ▲6.07
Add New Post /wp-admin/post-new.php6.28 ▲0.4096.61 ▼85.40
Media Library /wp-admin/upload.php3.61 ▲0.3838.78 ▲6.20
Trash Log /wp-admin/admin.php?page=trash_log3.5536.86
Settings /wp-admin/admin.php?page=trash_duplicates_settings3.5735.15
301 Redirects /wp-admin/admin.php?page=301_redirects3.5535.38
About Trash Duplicates /wp-admin/admin.php?page=about_trash_duplicates3.62669.91

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 18 new files
Database: 2 new tables, 9 new options
New tables
wp_tdrd_log_details
wp_tdrd_redirection
New WordPress options
db_upgraded
widget_recent-posts
plugin_theme
theysaidso_admin_options
tdrd_promo_time
widget_theysaidso_widget
can_compress_scripts
tdr_version
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Trash Duplicate and 301 Redirect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,017 ▲25514.14 ▼0.571.86 ▲0.1046.01 ▼1.23
Dashboard /wp-admin2,407 ▲2275.71 ▲0.05104.43 ▲14.7186.13 ▲46.07
Posts /wp-admin/edit.php2,233 ▲1331.98 ▼0.0337.35 ▼9.5234.08 ▼2.33
Add New Post /wp-admin/post-new.php1,657 ▲14023.22 ▲4.64722.99 ▲144.0955.80 ▲9.32
Media Library /wp-admin/upload.php1,527 ▲1304.28 ▲0.0899.74 ▼5.7667.59 ▲23.43
Trash Log /wp-admin/admin.php?page=trash_log9091.6928.0726.62
Settings /wp-admin/admin.php?page=trash_duplicates_settings9241.6629.4125.04
301 Redirects /wp-admin/admin.php?page=301_redirects1,1001.9726.1345.62
About Trash Duplicates /wp-admin/admin.php?page=about_trash_duplicates1,1211.6925.7834.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 2 tables
    • wp_tdrd_redirection
    • wp_tdrd_log_details
  • The uninstall procedure has failed, leaving 10 options in the database
    • tdr_version
    • tdrd_promo_time
    • tdrd_is_optin
    • plugin_theme
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=301_redirects
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=about_trash_duplicates
    • > Warning in wp-content/plugins/trash-duplicate-and-301-redirect/includes/about_us.php+15
    simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found
    • > GET request to /wp-admin/admin.php?page=about_trash_duplicates
    • > Warning in wp-content/plugins/trash-duplicate-and-301-redirect/includes/about_us.php+15
    simplexml_load_string(): 502 - Bad Gateway | This is a temporary error. Please try again later.
    • > GET request to /wp-admin/admin.php?page=about_trash_duplicates
    • > Warning in wp-content/plugins/trash-duplicate-and-301-redirect/includes/about_us.php+15
    simplexml_load_string(): ^
    • > GET request to /wp-admin/admin.php?page=about_trash_duplicates
    • > Notice in wp-content/plugins/trash-duplicate-and-301-redirect/includes/about_us.php+115
    Trying to get property 'plugins' of non-object
    • > GET request to /wp-admin/admin.php?page=about_trash_duplicates
    • > Notice in wp-content/plugins/trash-duplicate-and-301-redirect/includes/about_us.php+134
    Trying to get property 'themes' of non-object

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/trash-duplicate-and-301-redirect/includes/about_us.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trash-duplicate-and-301-redirect/includes/promo_notice.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can look at the official readme.txt

trash-duplicate-and-301-redirect/trash-duplicates.php 85% from 13 tests

The entry point to "Trash Duplicate and 301 Redirect" version 1.4.9 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("trash-duplicate-and-301-redirect.php" instead of "trash-duplicates.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin3,762 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP7952522,376
CSS21361,151
JavaScript2193235

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/down.png1.47KB1.28KB▼ 13.04%
images/logo-200.png9.00KB4.86KB▼ 45.98%
images/logo.png7.19KB4.19KB▼ 41.78%
images/support-ticket.png3.78KB2.00KB▼ 47.16%
images/up.png1.44KB1.26KB▼ 12.44%