84% carbon-copy

Code Review | Carbon Copy

WordPress plugin Carbon Copy scored84%from 54 tests.

About plugin

  • Plugin page: carbon-copy
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Aug 12, 2020
  • Latest release: Nov 8, 2023
  • Number of updates: 29
  • Update frequency: every 40.8 days
  • Top authors: endurox (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /10,230 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.22MB] [CPU: ▼3.75ms] Passed 4 tests

Server-side resources used by Carbon Copy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0536.06 ▼0.48
Dashboard /wp-admin3.59 ▲0.2848.43 ▼1.25
Posts /wp-admin/edit.php3.70 ▲0.3450.73 ▼0.23
Add New Post /wp-admin/post-new.php6.17 ▲0.2885.63 ▼13.05
Media Library /wp-admin/upload.php3.51 ▲0.2834.45 ▲1.69
Carbon Copy /wp-admin/options-general.php?page=carboncopy3.4833.50

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 36 new options
New WordPress options
carbon_copy_copycomments
carbon_copy_show_submitbox
widget_recent-posts
carbon_copy_version
carbon_copy_show_original_in_post_states
carbon_copy_blacklist
carbon_copy_widgets_classic
widget_theysaidso_widget
carbon_copy_show_row
carbon_copy_taxonomies_blacklist
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Carbon Copy
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.67 ▼0.041.48 ▼0.0339.17 ▼1.36
Dashboard /wp-admin2,196 ▲195.49 ▼0.1387.59 ▼1.1641.04 ▼0.90
Posts /wp-admin/edit.php2,115 ▲181.98 ▼0.0340.72 ▲1.9436.87 ▲0.99
Add New Post /wp-admin/post-new.php1,529 ▲323.06 ▼0.10641.92 ▼54.0358.41 ▲2.60
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.0096.59 ▼0.8342.86 ▲2.01
Carbon Copy /wp-admin/options-general.php?page=carboncopy1,2922.1839.1239.50

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

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)
Even though everything seems fine, this is not 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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/carbon-copy/carbon-copy-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/carbon-copy/carbon-copy-common.php:242

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Backend page/post 'Copy' and 'New Draft' links.), #2 (Backend page/post Edit screen 'Copy to new draft' links.), #3 (Frontend admin bar 'Copy to new draft' link.), #4 (Copy Widget link, Appearance > Widgets), #5 (Menu Copy page, Appearance > Carbon Copy Menu), #6 (Carbon Copy Settings > Options.)
The official readme.txt is a good inspiration

carbon-copy/carbon-copy.php Passed 13 tests

This is the main PHP file of "Carbon Copy" version 1.3.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
68 characters long description:
Copy pages, posts, menus, widgets and more quickly and conveniently.

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,617 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP52231271,615
CSS1002

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.46
Average class complexity6.50
▷ Minimum class complexity2.00
▷ Maximum class complexity11.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions50
▷ Named functions50100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.32MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png39.42KB16.49KB▼ 58.15%
screenshot-4.png4.84KB2.38KB▼ 50.79%
screenshot-6.png165.36KB68.89KB▼ 58.34%
screenshot-2.png66.49KB27.43KB▼ 58.74%
screenshot-5.png32.84KB14.08KB▼ 57.12%