79% catch-duplicate-switcher

Code Review | Catch Duplicate Switcher

WordPress plugin Catch Duplicate Switcher scored79%from 54 tests.

About plugin

  • Plugin page: catch-duplicate-s...
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Jan 23, 2019
  • Latest release: Nov 15, 2023
  • Number of updates: 18
  • Update frequency: every 97.7 days
  • Top authors: catchthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,533 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.22MB] [CPU: ▼0.47ms] Passed 4 tests

Server-side resources used by Catch Duplicate Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2239.49 ▼1.79
Dashboard /wp-admin3.52 ▲0.2245.14 ▼5.42
Posts /wp-admin/edit.php3.64 ▲0.2848.88 ▲1.91
Add New Post /wp-admin/post-new.php6.13 ▲0.2491.95 ▲3.41
Media Library /wp-admin/upload.php3.45 ▲0.2137.20 ▲6.73

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Catch Duplicate Switcher
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲12913.40 ▼0.888.62 ▲6.8336.93 ▼7.03
Dashboard /wp-admin2,213 ▲365.62 ▲0.0893.26 ▼3.1846.28 ▲0.77
Posts /wp-admin/edit.php2,163 ▲631.99 ▼0.0441.82 ▲5.3937.07 ▲1.70
Add New Post /wp-admin/post-new.php6,263 ▲4,73725.97 ▲2.91975.82 ▲345.2158.24 ▲9.26
Media Library /wp-admin/upload.php1,418 ▲154.09 ▼0.1099.89 ▼1.4345.78 ▲0.67

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/catch-duplicate-switcher/public/partials/catch-duplicate-switcher-public-display.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/catch-duplicate-switcher/admin/partials/footer.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-duplicate-switcher/admin/partials/catch-duplicate-switcher-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-duplicate-switcher/admin/partials/sidebar.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_action() in wp-content/plugins/catch-duplicate-switcher/includes/CatchThemesThemePlugin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-duplicate-switcher/admin/partials/dashboard-display.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/catch-duplicate-switcher/catch-duplicate-switcher.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-duplicate-switcher/admin/partials/switcher.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-duplicate-switcher/includes/ctp-tabs-removal.php:16

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: duplicate, copy, post type, switcher, clone

catch-duplicate-switcher/catch-duplicate-switcher.php Passed 13 tests

Analyzing the main PHP file in "Catch Duplicate Switcher" version 1.9
60 characters long description:
Create duplicate posts/pages and switch between them easily.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,027 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP183326741,208
CSS314222697
JavaScript62739122

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.31
Average class complexity17.12
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods50
▷ Static methods36.00%
▷ Public methods4386.00%
▷ Protected methods00.00%
▷ Private methods714.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/premium-plugin-246x116.png9.01KB4.16KB▼ 53.83%
admin/images/free-plugin-246x116.png8.01KB3.81KB▼ 52.42%