84% post-cloner

Code Review | Post Cloner

WordPress plugin Post Cloner scored84%from 54 tests.

About plugin

  • Plugin page: post-cloner
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0
  • WordPress version: 6.3.1
  • First release: Sep 18, 2015
  • Latest release: Jun 2, 2022
  • Number of updates: 15
  • Update frequency: every 163.3 days
  • Top authors: eherman24 (80%)brothman01 (26.67%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /17,651 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.12ms] Passed 4 tests

This is a short check of server-side resources used by Post Cloner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.80 ▲3.21
Dashboard /wp-admin3.32 ▼0.0249.18 ▼11.96
Posts /wp-admin/edit.php3.38 ▲0.0246.63 ▲4.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.70 ▼2.63
Media Library /wp-admin/upload.php3.25 ▲0.0235.58 ▲2.89
WP Post Cloner /wp-admin/options-general.php?page=wp-post-cloner-settings3.2429.52

Server storage [IO: ▲0.12MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Post Cloner: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.67 ▼0.725.16 ▲3.5239.37 ▼1.28
Dashboard /wp-admin2,207 ▲165.80 ▲0.9596.10 ▼4.9437.90 ▼0.26
Posts /wp-admin/edit.php2,097 ▲111.99 ▼0.0639.53 ▲4.3335.19 ▼0.49
Add New Post /wp-admin/post-new.php1,545 ▲1118.30 ▼4.88586.78 ▼77.5547.78 ▼10.02
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.0292.79 ▼5.6441.73 ▼4.48
WP Post Cloner /wp-admin/options-general.php?page=wp-post-cloner-settings9332.0137.1632.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/post-cloner/wp-post-cloner.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/post-cloner/includes/wp-post-duplicator-settings.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: You are using too many tags: 24 tag instead of maximum 10
You can look at the official readme.txt

post-cloner/wp-post-cloner.php 92% from 13 tests

The main file in "Post Cloner" v. 0.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("post-cloner.php" instead of "wp-post-cloner.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
No dangerous file extensions were detected782 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS112526557
PHP23677196
Markdown116021
JavaScript25158

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/css/select2.png0.60KB0.99KB0.00%
includes/css/select2x2.png0.83KB0.77KB▼ 6.15%