10% code-clone

Code Review | Code Clone

WordPress plugin Code Clone scored10%from 54 tests.

About plugin

  • Plugin page: code-clone
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.5.2
  • WordPress version: 6.3.1
  • First release: Sep 17, 2013
  • Latest release: Sep 17, 2013
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: allhart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,461 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/code-clone/admin/uninstall.php+35
    Use of undefined constant cc_INSERT_HTML_PLUGIN_FILE - assumed 'cc_INSERT_HTML_PLUGIN_FILE' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.95MB] [CPU: ▼56.68ms] Passed 4 tests

Analyzing server-side resources used by Code Clone
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.60 ▼39.33
Dashboard /wp-admin2.05 ▼1.256.55 ▼52.23
Posts /wp-admin/edit.php2.05 ▼1.305.95 ▼46.00
Add New Post /wp-admin/post-new.php2.05 ▼3.835.91 ▼89.17
Media Library /wp-admin/upload.php2.05 ▼1.186.20 ▼30.52
HTML Codes /wp-admin/admin.php?page=insert-html-snippet-manage2.055.30
Settings /wp-admin/admin.php?page=insert-html-snippet-settings2.055.72

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 37 new files
Database: 1 new table, 9 new options
New tables
wp_cc_ihs_short_code
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
cc_credit_link
widget_cc_insert_html_widget
theysaidso_admin_options
cc_ihs_limit
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Code Clone
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲19913.68 ▼0.346.10 ▲3.6437.70 ▼11.56
Dashboard /wp-admin2,224 ▲365.87 ▲0.96109.45 ▼1.0677.69 ▲34.27
Posts /wp-admin/edit.php2,125 ▲362.05 ▲0.0737.82 ▼1.8933.32 ▼3.04
Add New Post /wp-admin/post-new.php1,694 ▲17722.60 ▲4.97727.78 ▲42.6257.18 ▲4.13
Media Library /wp-admin/upload.php1,418 ▲304.17 ▼0.0395.02 ▼15.8673.76 ▲26.57
HTML Codes /wp-admin/admin.php?page=insert-html-snippet-manage8642.0724.0131.48
Settings /wp-admin/admin.php?page=insert-html-snippet-settings8552.0726.9437.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_cc_ihs_short_code
  • Zombie WordPress options detected upon uninstall: 9 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_cc_insert_html_widget
    • cc_credit_link
    • widget_recent-posts
    • widget_recent-comments
    • cc_ihs_limit

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=insert-html-snippet-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=insert-html-snippet-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the cc_notice_script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=insert-html-snippet-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the cc_notice_script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=insert-html-snippet-settings
    • > Warning in wp-content/plugins/code-clone/admin/uninstall.php+35
    Use of undefined constant cc_INSERT_HTML_PLUGIN_FILE - assumed 'cc_INSERT_HTML_PLUGIN_FILE' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=insert-html-snippet-settings
    • > Deprecated in wp-content/plugins/code-clone/widget.php+91
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=insert-html-snippet-settings
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in cc_Insert_Html_Widget is deprecated since version 4.3.0! Use __construct() instead.

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
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/code-clone/admin/header.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function stripslashes_deep() in wp-content/plugins/code-clone/admin/snippet-delete.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function stripslashes_deep() in wp-content/plugins/code-clone/admin/snippet-status.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-clone/admin/ajax-backlink.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/code-clone/direct_call.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-clone/add_shortcode_tynimce.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/code-clone/admin/settings.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_uninstall_hook() in wp-content/plugins/code-clone/admin/uninstall.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/code-clone/admin/menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-clone/accordion.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

code-clone/insert-html-snippet.php 77% from 13 tests

This is the main PHP file of "Code Clone" version 0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("code-clone.php" instead of "insert-html-snippet.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 604 characters long)
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

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
Good job! No executable or dangerous file extensions detected1,259 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP223541121,042
CSS1561205
JavaScript13012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity6.00
▷ Minimum class complexity5.00
▷ Maximum class complexity7.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
10 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/support.png0.71KB0.80KB0.00%
images/gplus.png3.34KB0.79KB▼ 76.37%
images/logo.png0.46KB0.41KB▼ 10.74%
images/facebook.png0.59KB0.66KB0.00%
images/edit.png3.18KB2.07KB▼ 34.91%