78% knowhalim-remove-duplicates

Code Review | KH Remove Duplicates

WordPress plugin KH Remove Duplicates scored 78% from 54 tests.

About plugin

  • Plugin page: knowhalim-remove-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 18, 2023
  • Latest release: Feb 22, 2023
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: webcreativemaster (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 224 total downloads

Benchmarks

Plugin footprint 82% 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.09MB] [CPU: ▼0.73ms] 75% from 4 tests

Server-side resources used by KH Remove Duplicates
Please have a look at the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 7,857.46ms on /wp-admin/options-general.php?page=remove-duplicate-posts)
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.65 ▼2.13
Dashboard /wp-admin3.39 ▲0.0956.36 ▲4.12
Posts /wp-admin/edit.php3.50 ▲0.1548.96 ▲4.64
Add New Post /wp-admin/post-new.php5.99 ▲0.1095.03 ▼0.25
Media Library /wp-admin/upload.php3.31 ▲0.0834.46 ▼4.67
Remove Duplicate Posts /wp-admin/options-general.php?page=remove-duplicate-posts3.297,857.46

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

KH Remove Duplicates: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15913.60 ▼0.775.55 ▲3.3948.05 ▲1.87
Dashboard /wp-admin2,211 ▲295.78 ▲0.84100.79 ▼23.1843.19 ▲0.28
Posts /wp-admin/edit.php2,097 ▲82.01 ▲0.0134.76 ▼2.3134.42 ▼0.14
Add New Post /wp-admin/post-new.php1,532 ▲1818.30 ▲0.66586.41 ▼166.1755.06 ▲0.59
Media Library /wp-admin/upload.php1,393 ▲54.18 ▼0.06102.62 ▼9.8644.47 ▼5.48
Remove Duplicate Posts /wp-admin/options-general.php?page=remove-duplicate-posts8922.0724.8332.86

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/knowhalim-remove-duplicates/admin/partials/kh-remove-duplicates-admin-display.php
    • > /wp-content/plugins/knowhalim-remove-duplicates/public/partials/kh-remove-duplicates-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/knowhalim-remove-duplicates/admin/class-kh-remove-duplicates-admin.php:301

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
2 plugin tags: duplicate, remove duplicate

knowhalim-remove-duplicates/kh-remove-duplicates.php 85% from 13 tests

The main PHP script in "KH Remove Duplicates" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("knowhalim-remove-duplicates.php" instead of "kh-remove-duplicates.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin410 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12175536359
CSS26826
JavaScript283525

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.38
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.59
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions5
▷ Named functions5100.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
PNG images were not found in this plugin