67% custom-codes

Code Review | CodeKit - Custom Codes Editor

WordPress plugin CodeKit - Custom Codes Editor scored67%from 54 tests.

About plugin

  • Plugin page: custom-codes
  • Plugin version: 2.3.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2017
  • Latest release: Aug 20, 2023
  • Number of updates: 107
  • Update frequency: every 21.2 days
  • Top authors: bilaltas (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /56,456 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲5.20MB] [CPU: ▲35.84ms] 75% from 4 tests

Analyzing server-side resources used by CodeKit - Custom Codes Editor
Please take the time to fix the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.20MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.93 ▲5.4773.71 ▲32.05
Dashboard /wp-admin8.95 ▲5.6592.83 ▲41.80
Posts /wp-admin/edit.php8.96 ▲5.6079.09 ▲33.65
Add New Post /wp-admin/post-new.php9.95 ▲4.06141.39 ▲49.21
Media Library /wp-admin/upload.php8.95 ▲5.7374.57 ▲35.86
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9668.47

Server storage [IO: ▲6.17MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/custom-codes/" and "wp-content/uploads/"
    • (new file) wp-content/custom_codes/.empty
Filesystem: 325 new files
Database: no new tables, 10 new options
New WordPress options
fs_accounts
db_upgraded
fs_active_plugins
widget_recent-comments
fs_debug_mode
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
_codes_version
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CodeKit - Custom Codes Editor
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲11014.25 ▼0.101.65 ▼0.1342.46 ▲0.39
Dashboard /wp-admin2,277 ▲995.57 ▼0.1496.51 ▼7.8975.63 ▲33.86
Posts /wp-admin/edit.php2,186 ▲861.96 ▼0.0735.84 ▼0.9135.15 ▲0.08
Add New Post /wp-admin/post-new.php1,758 ▲23023.30 ▼0.02741.50 ▲136.3151.70 ▼0.52
Media Library /wp-admin/upload.php1,479 ▲794.23 ▲0.0397.96 ▼15.9978.00 ▲30.38
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1371.6924.5829.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/custom-codes/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • fs_active_plugins
    • fs_accounts
    • widget_recent-comments
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 19× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/custom-codes/lib/views/settings-area.php
    • > /wp-content/plugins/custom-codes/lib/permissions.php
    • > /wp-content/plugins/custom-codes/lib/compilers/style/scss/scss.php
    • > /wp-content/plugins/custom-codes/lib/editor-includes.php
    • > /wp-content/plugins/custom-codes/lib/views/description-area.php
    • > /wp-content/plugins/custom-codes/lib/release-codes.php
    • > /wp-content/plugins/custom-codes/lib/views/editor-area.php
    • > /wp-content/plugins/custom-codes/lib/upgrade.php
    • > /wp-content/plugins/custom-codes/lib/views/locations-area.php
    • > /wp-content/plugins/custom-codes/lib/helper-functions.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'ScssPhp\\ScssPhp\\Exception\\SassException' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Exception/RangeException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Formatter/Debug.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'ScssPhp\\ScssPhp\\Exception\\SassException' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Exception/CompilerException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Formatter/Nested.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\ode' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Node/Number.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Formatter/Compact.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'ScssPhp\\ScssPhp\\Exception\\SassException' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Exception/ParserException.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'ScssPhp\\ScssPhp\\Exception\\SassException' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Exception/ServerException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Formatter/Expanded.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/custom-codes/lib/compilers/style/scss/vendor/scssphp/scssphp/src/Formatter/Compressed.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 21 tag instead of maximum 10
The official readme.txt might help

custom-codes/custom-codes.php Passed 13 tests

The main PHP script in "CodeKit - Custom Codes Editor" version 2.3.6 is automatically included on every request by WordPress
67 characters long description:
Your custom SASS, CSS, JS and PHP customizations in same directory.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin87,381 lines of code in 268 files:
LanguageFilesBlank linesComment linesLines of code
PHP17911,58621,96046,620
JavaScript312,9854,65837,232
CSS23239451,441
Sass21855783
JSON800656
PO File1264297539
Markdown328058
SVG190045
XML2157

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 201)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity83.60
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.98
▷ Minimum method complexity1.00
▷ Maximum method complexity201.00
Code structure
Namespaces10
Interfaces1
Traits0
Classes82
▷ Abstract classes44.88%
▷ Concrete classes7895.12%
▷ Final classes11.28%
Methods1,740
▷ Static methods23413.45%
▷ Public methods1,02358.79%
▷ Protected methods32318.56%
▷ Private methods39422.64%
Functions188
▷ Named functions16185.64%
▷ Anonymous functions2714.36%
Constants228
▷ Global constants11048.25%
▷ Class constants11851.75%
▷ Public constants118100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/custom-codes.png3.65KB1.72KB▼ 52.97%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%