83% copy-the-code

Code Review | Copy Anything to Clipboard

WordPress plugin Copy Anything to Clipboard scored83%from 54 tests.

About plugin

  • Plugin page: copy-the-code
  • Plugin version: 3.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4.1
  • WordPress version: 6.3.1
  • First release: May 30, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 72
  • Update frequency: every 27.9 days
  • Top authors: Mahesh901122 (62.5%)surror (38.89%)

Code review

54 tests

User reviews

30 reviews

Install metrics

10,000+ active /155,268 total downloads

Benchmarks

Plugin footprint 82% 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: ▲5.37MB] [CPU: ▲29.89ms] 75% from 4 tests

Server-side resources used by Copy Anything to Clipboard
Please have a look at the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.37MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.13 ▲5.6771.36 ▲32.52
Dashboard /wp-admin9.15 ▲5.8183.23 ▲20.67
Posts /wp-admin/edit.php9.15 ▲5.8088.35 ▲38.49
Add New Post /wp-admin/post-new.php10.09 ▲4.21124.18 ▲29.01
Media Library /wp-admin/upload.php9.15 ▲5.9269.94 ▲37.36
→ Add New /wp-admin/options-general.php?page=copy-the-code9.1568.37
Copy to Clipboard /wp-admin/edit.php?post_type=copy-to-clipboard9.1586.41
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.1563.21

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 264 new files
Database: no new tables, 11 new options
New WordPress options
fs_debug_mode
copy_the_code_fresh_user
fs_active_plugins
widget_theysaidso_widget
fs_accounts
theysaidso_admin_options
copy-the-code-auto-version
db_upgraded
widget_recent-posts
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Copy Anything to Clipboard
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲18813.81 ▼0.468.50 ▲6.8528.40 ▼18.86
Dashboard /wp-admin2,220 ▲425.56 ▼0.1190.50 ▼24.0744.60 ▲2.70
Posts /wp-admin/edit.php2,131 ▲342.11 ▲0.0940.29 ▲0.6643.01 ▲3.02
Add New Post /wp-admin/post-new.php1,549 ▲2324.91 ▲1.91613.82 ▼46.3562.75 ▲6.54
Media Library /wp-admin/upload.php1,428 ▲254.19 ▲0.0694.88 ▼4.2744.94 ▲4.26
→ Add New /wp-admin/options-general.php?page=copy-the-code1,0253.0040.6566.39
Copy to Clipboard /wp-admin/edit.php?post_type=copy-to-clipboard1,1501.9664.2652.78
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0801.6623.6928.27

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 11 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • copy_the_code_fresh_user
    • copy-the-code-auto-version
    • fs_debug_mode
    • widget_recent-posts
    • fs_accounts
    • db_upgraded
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 29× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/copy-the-code/classes/elementor/widgets/coupon/widget.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/copy-the-code/classes/class-copy-the-code-shortcode.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/copy-the-code/classes/elementor/widgets/code-snippet/widget.php:19
    • > PHP Warning
      require_once(COPY_THE_CODE_DIRclasses/class-copy-the-code-update.php): failed to open stream: No such file or directory in wp-content/plugins/copy-the-code/classes/class-copy-the-code.php on line 46
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/copy-the-code/classes/elementor/widgets/wish/widget.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/copy-the-code/classes/elementor/widgets/copy-button/widget.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/copy-the-code/classes/opt-in/class-copy-the-code-opt-in.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_clear_scheduled_hook() in wp-content/plugins/copy-the-code/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/copy-the-code/classes/elementor/widgets/message/widget.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/copy-the-code/classes/elementor/widgets/shayari/widget.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5 in copy-the-code/assets to your readme.txt
You can look at the official readme.txt

copy-the-code/copy-the-code.php 92% from 13 tests

The main PHP script in "Copy Anything to Clipboard" version 3.4.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 361 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected40,855 lines of code in 216 files:
LanguageFilesBlank linesComment linesLines of code
PHP1518,72018,91438,645
JavaScript232672701,233
CSS4014632819
PO File15363142
XML13016

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity61.86
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.19
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes77
▷ Abstract classes22.60%
▷ Concrete classes7597.40%
▷ Final classes00.00%
Methods1,515
▷ Static methods23615.58%
▷ Public methods1,09372.15%
▷ Protected methods322.11%
▷ Private methods39025.74%
Functions104
▷ Named functions10399.04%
▷ Anonymous functions10.96%
Constants151
▷ Global constants10468.87%
▷ Class constants4731.13%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
classes/freemius/assets/img/copy-the-code.png10.35KB4.56KB▼ 55.95%
classes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
classes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%