84% duplicate-page-or-post

Code Review | Duplicate Page or Post

WordPress plugin Duplicate Page or Post scored84%from 54 tests.

About plugin

  • Plugin page: duplicate-page-or...
  • Plugin version: 1.5.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 27, 2019
  • Latest release: Mar 31, 2023
  • Number of updates: 135
  • Update frequency: every 8.8 days
  • Top authors: wpdevart (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

10,000+ active /183,432 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.95ms] Passed 4 tests

An overview of server-side resources used by Duplicate Page or Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.16 ▲0.18
Dashboard /wp-admin3.33 ▲0.0344.65 ▼1.31
Posts /wp-admin/edit.php3.38 ▲0.0344.76 ▼4.61
Add New Post /wp-admin/post-new.php5.91 ▲0.0382.67 ▼16.03
Media Library /wp-admin/upload.php3.26 ▲0.0335.34 ▼1.85
Featured Plugins /wp-admin/admin.php?page=wpda_duplicate_post_feature_plugin3.2232.16
Duplicate Post /wp-admin/admin.php?page=wpda_duplicate_post_menu3.2240.88

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 82 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Duplicate Page or Post: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.39 ▼1.381.73 ▼0.0745.21 ▲0.12
Dashboard /wp-admin2,238 ▲475.85 ▲0.9797.52 ▼4.4440.03 ▼2.44
Posts /wp-admin/edit.php2,125 ▲362.01 ▼0.0335.58 ▼5.5832.40 ▼2.19
Add New Post /wp-admin/post-new.php1,568 ▲3523.40 ▲0.22652.18 ▼24.8658.47 ▲10.57
Media Library /wp-admin/upload.php1,420 ▲324.18 ▼0.0594.36 ▼7.7941.39 ▼3.71
Featured Plugins /wp-admin/admin.php?page=wpda_duplicate_post_feature_plugin1,0992.0221.6738.97
Duplicate Post /wp-admin/admin.php?page=wpda_duplicate_post_menu1,2071.6825.8928.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/duplicate-page-or-post/wpdevart-duplicate-post.php:45

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 uses markdown syntax to describe your plugin to the world
5 plugin tags: clone, duplicate page, clone page, duplicate post, clone post

duplicate-page-or-post/wpdevart-duplicate-post.php 92% from 13 tests

The entry point to "Duplicate Page or Post" version 1.5.6 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("duplicate-page-or-post.php" instead of "wpdevart-duplicate-post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected5,328 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PO File2910,64320,2724,507
PHP24339657
CSS130127
JavaScript12037

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity22.00
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods1136.67%
▷ Protected methods00.00%
▷ Private methods1963.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
14 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/featured_plugins/Pricing-table.png12.94KB4.08KB▼ 68.44%
admin/images/featured_plugins/countdown-extended.png13.21KB5.74KB▼ 56.53%
admin/images/featured_plugins/facebook-comments-icon.png35.59KB9.23KB▼ 74.06%
admin/images/featured_plugins/chart-featured.png9.09KB4.30KB▼ 52.70%
admin/images/featured_plugins/gallery-album-icon.png10.74KB4.69KB▼ 56.38%