78% chameleon

Code Review | Chameleon

WordPress plugin Chameleon scored78%from 54 tests.

About plugin

  • Plugin page: chameleon
  • Plugin version: 1.4.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Jan 20, 2017
  • Latest release: May 24, 2023
  • Number of updates: 98
  • Update frequency: every 23.6 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /23,881 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.42MB] [CPU: ▲7.47ms] Passed 4 tests

A check of server-side resources used by Chameleon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5852.67 ▲13.58
Dashboard /wp-admin3.70 ▲0.4055.56 ▲5.54
Posts /wp-admin/edit.php3.81 ▲0.4660.06 ▲16.49
Add New Post /wp-admin/post-new.php6.30 ▲0.4188.78 ▼5.75
Media Library /wp-admin/upload.php3.62 ▲0.3954.01 ▲23.22
Chameleon /wp-admin/options-general.php?page=wpc3.66324.25

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 656 new files
Database: no new tables, 8 new options
New WordPress options
wp_chameleon
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
wp_chameleon_background
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Chameleon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲15713.68 ▼0.626.42 ▲4.0837.12 ▼6.88
Dashboard /wp-admin2,222 ▲345.00 ▲0.12109.72 ▼7.9541.62 ▼6.18
Posts /wp-admin/edit.php2,105 ▲162.04 ▲0.0443.94 ▲8.3337.94 ▲1.23
Add New Post /wp-admin/post-new.php1,526 ▲317.61 ▼5.70666.77 ▲9.6953.53 ▼2.12
Media Library /wp-admin/upload.php1,404 ▲164.26 ▲0.0495.39 ▼6.0342.18 ▼1.71
Chameleon /wp-admin/options-general.php?page=wpc5,05732.451,006.96156.05

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
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wp_chameleon_background
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • wp_chameleon
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wpc
    • > Warning in wp-content/plugins/chameleon/inc/functions.php+1069
    copy(https://raw.githubusercontent.com/uxglow/twentytwentyone/master/twentytwentyone-covid19/1.0/thumb.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

    • > GET request to /wp-admin/options-general.php?page=wpc
    • > Warning in wp-content/plugins/chameleon/inc/functions.php+1072
    copy(https://raw.githubusercontent.com/uxglow/twentytwentyone/master/twentytwentyone-covid19/1.0/screenshot.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

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
The following issues need your attention
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/chameleon/templates/nti/shortcode.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_sidebar() in wp-content/plugins/chameleon/assets/twentytwentyone/twentytwentyone-covid19/functions/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/chameleon/templates/nti/nti_styles.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/chameleon/index.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/chameleon/templates/nti/nti_scripts.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/chameleon/inc/functions.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/chameleon/inc/wpc_settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/chameleon/templates/nti/wpch_news_ticker.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: alphabetic, contact, rss feed, form, contact form...

chameleon/index.php 92% from 13 tests

Analyzing the main PHP file in "Chameleon" version 1.4.5
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("chameleon.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected44,686 lines of code in 237 files:
LanguageFilesBlank linesComment linesLines of code
CSS1332,6851,53731,440
JavaScript111,6471,6967,156
HTML82631494,490
PHP86432231,390
PO File38181210

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.56
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%
Functions34
▷ Named functions3294.12%
▷ Anonymous functions25.88%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
166 PNG files occupy 4.40MB with 2.54MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/ap/uber/images/screenshot.png4.71KB4.45KB▼ 5.61%
assets/cs/soon/flags/NI.png3.08KB0.44KB▼ 85.70%
assets/cs/soon/flags/MX.png3.34KB0.87KB▼ 73.90%
assets/cs/soon/flags/TD.png3.23KB0.86KB▼ 73.43%
images/nti_sample.png4.94KB2.44KB▼ 50.57%