84% shortcake-field-chosen

Code Review | Shortcake Field Chosen

WordPress plugin Shortcake Field Chosen scored84%from 54 tests.

About plugin

  • Plugin page: shortcake-field-c...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 20, 2016
  • Latest release: May 23, 2017
  • Number of updates: 9
  • Update frequency: every 30.7 days
  • Top authors: perturbatio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /611 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼11.79ms] Passed 4 tests

Server-side resources used by Shortcake Field Chosen
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0532.72 ▼7.00
Dashboard /wp-admin3.35 ▲0.0143.91 ▼15.57
Posts /wp-admin/edit.php3.46 ▲0.1145.45 ▼4.90
Add New Post /wp-admin/post-new.php5.95 ▲0.0782.35 ▼19.70
Media Library /wp-admin/upload.php3.27 ▲0.0536.61 ▲4.15

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Shortcake Field Chosen
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.21 ▼1.381.74 ▼0.1740.96 ▼4.97
Dashboard /wp-admin2,212 ▲245.89 ▲0.04104.46 ▼13.0741.59 ▼6.46
Posts /wp-admin/edit.php2,095 ▲62.08 ▲0.0735.68 ▲1.3032.05 ▼3.30
Add New Post /wp-admin/post-new.php1,520 ▲123.16 ▲0.06678.10 ▲14.1861.86 ▲6.21
Media Library /wp-admin/upload.php1,397 ▲94.22 ▲0.0394.90 ▼10.7342.92 ▼4.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/shortcake-field-chosen/admin/partials/tmpl-shortcode-ui-field-chosen.tpl.php

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Contributors: Contributors not specified
You can look at the official readme.txt

shortcake-field-chosen/shortcake-field-chosen.php Passed 13 tests

"Shortcake Field Chosen" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
91 characters long description:
Provides a jQuery chosen select field as an option for the Shortcake (Shortcode UI) plugin.

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
Everything looks great! No dangerous files found in this plugin6,592 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
HTML36503,200
JavaScript7210372,433
CSS46336663
PHP1096428165
JSON20094
Markdown119037

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods1780.95%
▷ Protected methods00.00%
▷ Private methods419.05%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
4 compressed PNG files occupy 0.01MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/js/chosen_v1.6.2/chosen-sprite.png0.53KB0.88KB0.00%
admin/js/chosen_v1.6.2/docsupport/oss-credit.png4.30KB3.26KB▼ 24.02%
admin/js/chosen_v1.6.2/docsupport/chosen.png1.47KB2.08KB0.00%
admin/js/chosen_v1.6.2/chosen-sprite@2x.png0.72KB0.83KB0.00%