78% tc-custom-javascript

Code Review | TC Custom JavaScript

WordPress plugin TC Custom JavaScript scored78%from 54 tests.

About plugin

  • Plugin page: tc-custom-javascript
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2015
  • Latest release: Feb 24, 2023
  • Number of updates: 25
  • Update frequency: every 114.6 days
  • Top authors: tinycode (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

10,000+ active /105,298 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.05ms] Passed 4 tests

This is a short check of server-side resources used by TC Custom JavaScript
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0346.61 ▲5.64
Dashboard /wp-admin3.33 ▲0.0354.22 ▼2.11
Posts /wp-admin/edit.php3.38 ▲0.0349.54 ▼2.31
Add New Post /wp-admin/post-new.php5.91 ▲0.03103.58 ▲1.22
Media Library /wp-admin/upload.php3.25 ▲0.0337.31 ▲2.99
Custom JavaScript /wp-admin/themes.php?page=tc-custom-javascript3.2234.31

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 431 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
tccj_do_activation_redirect
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

TC Custom JavaScript: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.44 ▲0.072.24 ▲0.5948.63 ▲6.78
Dashboard /wp-admin2,199 ▲345.62 ▲0.0786.47 ▼4.0538.29 ▼8.50
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0540.74 ▲3.5936.81 ▲1.81
Add New Post /wp-admin/post-new.php1,529 ▼1617.57 ▼5.65587.45 ▼67.6258.44 ▲6.77
Media Library /wp-admin/upload.php1,401 ▲14.22 ▲0.0495.14 ▼13.0242.61 ▼4.78
Custom JavaScript /wp-admin/themes.php?page=tc-custom-javascript9742.4237.9760.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • tccj_do_activation_redirect
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tc-custom-javascript/tc-custom-javascript.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'TCCJ_PLUGIN_DIRcore/asset.php' (include_path='.:/usr/share/php') in wp-content/plugins/tc-custom-javascript/core/plugin.php on line 3
    • > PHP Warning
      require_once(TCCJ_PLUGIN_DIRcore/asset.php): failed to open stream: No such file or directory in wp-content/plugins/tc-custom-javascript/core/plugin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tc-custom-javascript/templates/code-editor.php:2
    • > PHP Warning
      Use of undefined constant TCCJ_PLUGIN_DIR - assumed 'TCCJ_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/tc-custom-javascript/core/plugin.php on line 3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: javascript editor, edit js theme, custom javascript, custom js

tc-custom-javascript/tc-custom-javascript.php 92% from 13 tests

The main file in "TC Custom JavaScript" v. 1.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 188 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected79,141 lines of code in 414 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1915,7473,90850,006
HTML1563,2341219,453
CSS523401998,969
SVG211467
PHP72318132
Markdown219069
JSON20037
Bourne Shell1015
YAML1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity10.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods9
▷ Static methods9100.00%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/codemirror/doc/yinyang.png4.52KB2.03KB▼ 55.19%
assets/codemirror/doc/logo.png9.09KB4.10KB▼ 54.95%