84% post-duplicator

Code Review | Post Duplicator

WordPress plugin Post Duplicator scored84%from 54 tests.

About plugin

  • Plugin page: post-duplicator
  • Plugin version: 2.32
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 28, 2012
  • Latest release: Nov 11, 2023
  • Number of updates: 84
  • Update frequency: every 50.2 days
  • Top authors: metaphorcreations (100%)

Code review

54 tests

User reviews

70 reviews

Install metrics

200,000+ active /2,015,780 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼2.66ms] Passed 4 tests

Server-side resources used by Post Duplicator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.44 ▲1.24
Dashboard /wp-admin3.45 ▲0.1548.44 ▼2.05
Posts /wp-admin/edit.php3.57 ▲0.2145.16 ▼3.36
Add New Post /wp-admin/post-new.php6.05 ▲0.1784.52 ▼6.47
Media Library /wp-admin/upload.php3.38 ▲0.1540.36 ▲5.56
Post Duplicator /wp-admin/tools.php?page=mtphr_post_duplicator_settings_menu3.3532.59

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
mtphr_post_duplicator_settings
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Post Duplicator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲914.54 ▲0.191.83 ▲0.1542.57 ▲1.32
Dashboard /wp-admin2,204 ▲235.64 ▼0.0489.53 ▼12.4239.27 ▼1.50
Posts /wp-admin/edit.php2,110 ▲102.01 ▼0.0136.82 ▼1.5931.73 ▼0.46
Add New Post /wp-admin/post-new.php1,540 ▲1425.20 ▲2.15614.88 ▼95.6963.25 ▲13.17
Media Library /wp-admin/upload.php1,403 ▲34.18 ▲0.0298.86 ▼8.1842.96 ▼1.34
Post Duplicator /wp-admin/tools.php?page=mtphr_post_duplicator_settings_menu1,0201.6624.2832.60

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • mtphr_post_duplicator_settings
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/post-duplicator/m4c-postduplicator.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-duplicator/includes/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/post-duplicator/includes/edit.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-duplicator/includes/scripts.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-duplicator/includes/notices.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-duplicator/includes/functions.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-duplicator/includes/ajax.php:134

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
4 plugin tags: duplicate, posts, duplication, post

post-duplicator/m4c-postduplicator.php 92% from 13 tests

The main PHP file in "Post Duplicator" ver. 2.32 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("post-duplicator.php" instead of "m4c-postduplicator.php")

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
There were no executable files found in this plugin1,046 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP10198203567
PO File5130238370
CSS1121286
JavaScript151023

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
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%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png38.21KB10.36KB▼ 72.88%
screenshot-1.png12.80KB5.64KB▼ 55.94%