83% copy-code-to-clipboard

Code Review | Copy Code To Clipboard

WordPress plugin Copy Code To Clipboard scored83%from 54 tests.

About plugin

  • Plugin page: copy-code-to-clip...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.3
  • WordPress version: 6.3.1
  • First release: Nov 11, 2019
  • Latest release: Nov 15, 2019
  • Number of updates: 31
  • Update frequency: every 0.2 days
  • Top authors: sach3932 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /4,093 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Copy Code To Clipboard
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.54 ▼1.98
Dashboard /wp-admin3.31 ▼0.0347.49 ▼14.79
Posts /wp-admin/edit.php3.37 ▲0.0152.73 ▲8.87
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.16 ▼2.87
Media Library /wp-admin/upload.php3.24 ▲0.0137.59 ▲2.90

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Copy Code To Clipboard
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲21813.99 ▼0.369.66 ▲7.7439.19 ▼8.42
Dashboard /wp-admin2,267 ▲905.70 ▲0.0382.39 ▼15.9580.45 ▲36.00
Posts /wp-admin/edit.php2,178 ▲752.30 ▲0.2839.62 ▲4.0135.58 ▼1.19
Add New Post /wp-admin/post-new.php1,587 ▲6123.24 ▲0.04695.81 ▼4.2135.66 ▼21.13
Media Library /wp-admin/upload.php1,466 ▲664.40 ▲0.21101.03 ▼4.6645.77 ▲0.63

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

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

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 no errors were found, this is by no means 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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/copy-code-to-clipboard/copy-code-clipboard.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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 your attention:
  • Screenshots: Please add images for these screenshots: #1 (Front Screen View), #2 (Admin Settings)
You can look at the official readme.txt

copy-code-to-clipboard/copy-code-clipboard.php 85% from 13 tests

The main PHP file in "Copy Code To Clipboard" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("copy-code-to-clipboard.php" instead of "copy-code-clipboard.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected190 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP1282384
JavaScript2141364
CSS12224
SVG10018

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
7 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png16.51KB7.78KB▼ 52.91%
images/screenshot-2.png29.76KB15.18KB▼ 49.00%
assets/screenshot-3.png17.59KB8.63KB▼ 50.97%
assets/screenshot-2.png29.76KB15.18KB▼ 49.00%
images/screenshot-1.png16.51KB7.78KB▼ 52.91%