84% duplica

Code Review | Duplica - Duplicate Posts, Pages, Custom Posts or Users

WordPress plugin Duplica - Duplicate Posts, Pages, Custom Posts or Users scored84%from 54 tests.

About plugin

  • Plugin page: duplica
  • Plugin version: 0.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 24, 2022
  • Latest release: Sep 5, 2023
  • Number of updates: 11
  • Update frequency: every 48.2 days
  • Top authors: codexpert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /5,898 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.46MB] [CPU: ▲0.20ms] Passed 4 tests

Server-side resources used by Duplica - Duplicate Posts, Pages, Custom Posts or Users
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1843.61 ▲3.08
Dashboard /wp-admin3.87 ▲0.5252.64 ▼9.47
Posts /wp-admin/edit.php3.92 ▲0.5755.84 ▲7.81
Add New Post /wp-admin/post-new.php6.47 ▲0.5892.89 ▼0.64
Media Library /wp-admin/upload.php3.79 ▲0.5646.22 ▲11.25

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
widget_recent-posts
duplica_version
theysaidso_admin_options
pl-survey_duplica-activated
widget_theysaidso_widget
widget_recent-comments
db_upgraded
duplica_install_time

Browser metrics Passed 4 tests

This is an overview of browser requirements for Duplica - Duplicate Posts, Pages, Custom Posts or Users
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲15313.50 ▼0.998.58 ▲6.9642.78 ▲1.74
Dashboard /wp-admin2,215 ▲415.58 ▼0.0281.63 ▼10.7878.37 ▲37.62
Posts /wp-admin/edit.php2,138 ▲412.05 ▲0.0136.78 ▼3.0133.99 ▼3.33
Add New Post /wp-admin/post-new.php1,712 ▲18422.09 ▼1.05724.85 ▲33.0058.39 ▲6.35
Media Library /wp-admin/upload.php1,435 ▲324.17 ▼0.03107.17 ▲7.1279.39 ▲34.62

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/duplica/inc/functions.php on line 5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/duplica/inc/functions.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/duplica/inc/functions.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function duplica_site_url() in wp-content/plugins/duplica/views/settings/help.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/duplica/inc/functions.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/duplica/inc/functions.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\Plugin\\Base' not found in wp-content/plugins/duplica/src/Settings.php:12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/duplica/inc/functions.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: clone posts, duplicate post, duplicate users, clone user, convert post...

duplica/duplica.php Passed 13 tests

The principal PHP file in "Duplica - Duplicate Posts, Pages, Custom Posts or Users" v. 0.6 is loaded by WordPress automatically on each request
79 characters long description:
Duplicate Posts, Pages, Custom Posts or Users - everything with a single click.

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
Success! There were no dangerous files found in this plugin5,620 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,1641,3454,163
CSS1015892
JavaScript8131292
JSON500170
PO File13737101
Markdown2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity24.70
▷ Minimum class complexity1.00
▷ Maximum class complexity228.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes30
▷ Abstract classes26.67%
▷ Concrete classes2893.33%
▷ Final classes13.57%
Methods271
▷ Static methods269.59%
▷ Public methods25794.83%
▷ Protected methods20.74%
▷ Private methods124.43%
Functions13
▷ Named functions646.15%
▷ Anonymous functions753.85%
Constants6
▷ Global constants6100.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.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codexpert/plugin/src/assets/img/checked.png18.81KB9.90KB▼ 47.36%
vendor/codexpert/plugin/src/assets/img/survey.png7.31KB3.08KB▼ 57.88%