84% duplicate-post

Code Review | Yoast Duplicate Post

WordPress plugin Yoast Duplicate Post scored 84% from 54 tests.

About plugin

  • Plugin page: duplicate-post
  • Plugin version: 4.4
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9
  • WordPress version: 5.9.2
  • First release: Dec 5, 2007
  • Latest release: Jan 25, 2022
  • Number of updates: 591
  • Update frequency: every 8.8 days
  • Top authors: lopo (99.66%)

Code review

54 tests

User reviews

498 reviews

Install metrics

4,000,000+ active / 28,046,645 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.84MB] [CPU: ▼297.57ms] Passed 4 tests

An overview of server-side resources used by Yoast Duplicate Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.88 ▲0.6883.25 ▲20.82
Dashboard /wp-admin5.00 ▲0.9745.58 ▲7.73
Posts /wp-admin/edit.php5.23 ▲0.9056.01 ▲13.69
Add New Post /wp-admin/post-new.php8.46 ▲0.87120.07 ▼1,220.06
Media Library /wp-admin/upload.php4.88 ▲0.9037.32 ▲8.38
Duplicate Post /wp-admin/options-general.php?page=duplicatepost4.8837.43

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 61 new files
Database: no new tables, 25 new options
New WordPress options
duplicate_post_copypassword
duplicate_post_show_original_column
duplicate_post_show_link
duplicate_post_copyformat
duplicate_post_copytemplate
duplicate_post_copyslug
duplicate_post_copychildren
duplicate_post_show_original_in_post_states
duplicate_post_copythumbnail
duplicate_post_copystatus
...

Browser metrics Passed 4 tests

A check of browser resources used by Yoast Duplicate Post
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,886 ▲12815.46 ▼0.567.36 ▲0.913.01 ▲0.17
Dashboard /wp-admin2,980 ▲1266.24 ▲0.06154.74 ▲4.62223.25 ▲63.94
Posts /wp-admin/edit.php2,728 ▲373.24 ▲0.0172.14 ▲4.29198.29 ▼5.91
Add New Post /wp-admin/post-new.php1,731 ▲7021.61 ▼0.86453.08 ▲7.27166.33 ▲6.11
Media Library /wp-admin/upload.php1,697 ▼15.49 ▼0.02141.37 ▼7.34200.14 ▼48.50
Duplicate Post /wp-admin/options-general.php?page=duplicatepost1,6592.5387.59131.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 25 options
    • duplicate_post_types_enabled
    • duplicate_post_copyformat
    • duplicate_post_version
    • duplicate_post_copytitle
    • duplicate_post_copydate
    • duplicate_post_copystatus
    • duplicate_post_show_notice
    • duplicate_post_copyauthor
    • duplicate_post_show_original_column
    • duplicate_post_copytemplate
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/duplicate-post/compat/jetpack-functions.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/duplicate-post/admin-functions.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/duplicate-post/compat/wpml-functions.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
3 plugin tags: duplicate post, clone, copy

duplicate-post/duplicate-post.php Passed 13 tests

"Yoast Duplicate Post" version 4.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
95 characters long description:
The go-to tool for cloning posts and pages, including the powerful Rewrite & Republish feature.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin4,891 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP501,0022,6794,773
CSS2182113
JavaScript5005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.43
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes00.00%
Methods248
▷ Static methods3212.90%
▷ Public methods23594.76%
▷ Protected methods93.63%
▷ Private methods41.61%
Functions36
▷ Named functions3288.89%
▷ Anonymous functions411.11%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
duplicate_post_yoast_icon-125x125.png18.35KB3.74KB▼ 79.62%