73% kc-settings

Code Review | KC Settings

WordPress plugin KC Settings scored 73% from 54 tests.

About plugin

  • Plugin page: kc-settings
  • Plugin version: 2.8.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5.2
  • WordPress version: 5.9.2
  • First release: Oct 26, 2010
  • Latest release: Jul 16, 2013
  • Number of updates: 129
  • Update frequency: every 7.7 days
  • Top authors: kucrut (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 7,368 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
Installer ran successfully

Server metrics [RAM: ▼1.05MB] [CPU: ▼328.19ms] Passed 4 tests

Analyzing server-side resources used by KC Settings
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.35 ▼0.1624.99 ▼28.49
Dashboard /wp-admin3.32 ▼0.0917.27 ▼27.52
Posts /wp-admin/edit.php3.32 ▼0.3219.86 ▼19.15
Add New Post /wp-admin/post-new.php3.32 ▼3.6516.84 ▼1,237.61
Media Library /wp-admin/upload.php3.32 ▲0.0318.08 ▼8.09
KC Settings /wp-admin/options-general.php?page=kcsb3.3218.28

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 82 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for KC Settings
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲2415.49 ▼0.146.28 ▲0.352.51 ▲0.48
Dashboard /wp-admin2,897 ▲376.14 ▼0.00129.42 ▲6.89235.93 ▲76.34
Posts /wp-admin/edit.php2,693 ▲23.23 ▼0.0265.80 ▲0.42143.56 ▼3.13
Add New Post /wp-admin/post-new.php1,755 ▲9421.80 ▼0.98458.15 ▼1.38235.91 ▲49.05
Media Library /wp-admin/upload.php1,697 ▼15.54 ▲0.09153.56 ▲2.98233.55 ▲44.76
KC Settings /wp-admin/options-general.php?page=kcsb3,7664.10138.49132.92

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
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/kc-settings/kc-settings-inc/options.php+158
    Declaration of kcWalker_Terms::start_el(&$output, $term, $depth, $args, $id = 0) should be compatible with Walker::start_el(&$output, $data_object, $depth = 0, $args = Array, $current_object_id = 0)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > Warning in wp-content/plugins/kc-settings/kc-settings-inc/options.php+158
    Declaration of kcWalker_Terms::start_el(&$output, $term, $depth, $args, $id = 0) should be compatible with Walker::start_el(&$output, $data_object, $depth = 0, $args = Array, $current_object_id = 0)
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > Warning in wp-content/plugins/kc-settings/kc-settings-inc/options.php+169
    Declaration of kcWalker_Posts::start_el(&$output, $post, $depth, $args, $id = 0) should be compatible with Walker::start_el(&$output, $data_object, $depth = 0, $args = Array, $current_object_id = 0)
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > User notice in wp-includes/functions.php+5768
    WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > Deprecated in wp-content/plugins/kc-settings/kc-settings-inc/helper.php+101
    The each() function is deprecated. This message will be suppressed on further calls
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/kc-settings/kc-settings-inc/doc/sample/03_term.php:11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/kc-settings/kc-settings-inc/builder-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/kc-settings/kc-settings-inc/options.php:153
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/kc-settings/kc-settings-inc/doc/sample/02_post.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/kc-settings/kc-settings-inc/theme.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu_Edit' not found in wp-content/plugins/kc-settings/kc-settings-inc/menu_item_ext.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/kc-settings/kc-settings-inc/doc/sample/04_user.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/kc-settings/kc-settings-inc/builder-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/kc-settings/kc-settings.php:851
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/kc-settings/kc-settings-inc/doc/sample/05_theme.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=kcsb
    • > Console-api (warning) in wp-content/plugins/kc-settings/kc-settings-inc/scripts/modernizr-2.6.2-20121030.min.js?ver=2.6.2-20121030+2:12297
    document.body doesn't exist. Modernizr hyphens test needs it.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

kc-settings/kc-settings.php Passed 13 tests

The main PHP script in "KC Settings" version 2.8.5 is automatically included on every request by WordPress
100 characters long description:
Easily create plugin/theme settings page, custom fields metaboxes, term meta and user meta settings.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin9,615 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP257086913,923
JavaScript171,0216683,578
CSS81171281,614
HTML1280500

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity22.71
▷ Minimum class complexity1.00
▷ Maximum class complexity147.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes314.29%
Methods114
▷ Static methods8070.18%
▷ Public methods10188.60%
▷ Protected methods00.00%
▷ Private methods1311.40%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
29 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
kc-settings-inc/styles/jquery-ui/flick/images/ui-icons_ff0084_256x240.png4.27KB4.11KB▼ 3.78%
kc-settings-inc/styles/chosen/chosen-sprite.png0.55KB0.70KB0.00%
kc-settings-inc/styles/jquery-ui/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png0.15KB0.15KB▼ 1.90%
kc-settings-inc/styles/jquery-ui/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png0.10KB0.17KB0.00%
kc-settings-inc/styles/jquery-ui/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png0.12KB0.18KB0.00%