84% cmb-field-type-sorter

Code Review | CMB Field Type: Sorter

WordPress plugin CMB Field Type: Sorter scored84%from 54 tests.

About plugin

  • Plugin page: cmb-field-type-so...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-4.2.2
  • WordPress version: 6.3.1
  • First release: May 20, 2015
  • Latest release: May 20, 2015
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: abit04c (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,113 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.09ms] Passed 4 tests

A check of server-side resources used by CMB Field Type: Sorter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.25 ▼3.60
Dashboard /wp-admin3.32 ▼0.0345.81 ▼20.57
Posts /wp-admin/edit.php3.38 ▲0.0149.01 ▼2.04
Add New Post /wp-admin/post-new.php5.91 ▲0.0192.18 ▼2.15
Media Library /wp-admin/upload.php3.25 ▲0.0135.40 ▼1.02

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CMB Field Type: Sorter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.23 ▼0.111.70 ▼0.1046.04 ▼0.78
Dashboard /wp-admin2,195 ▲185.58 ▲0.0490.19 ▼11.6645.30 ▲2.66
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0239.35 ▲1.7535.04 ▲0.59
Add New Post /wp-admin/post-new.php1,526 ▼222.97 ▼0.07665.25 ▼60.5853.99 ▲0.23
Media Library /wp-admin/upload.php1,403 ▲34.24 ▲0.03100.31 ▼16.4442.62 ▼3.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cmb-field-type-sorter/cmb-field-sorter.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected


Plugin configuration 93% 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
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (admin panel), #2 (drag drop), #3 (output value)
Please take inspiration from this readme.txt

cmb-field-type-sorter/cmb-field-sorter.php 92% from 13 tests

The main PHP file in "CMB Field Type: Sorter" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cmb-field-type-sorter.php" instead of "cmb-field-sorter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin145 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions4100.00%
▷ Anonymous functions00.00%
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png6.89KB4.74KB▼ 31.20%
screenshot-3.png9.86KB4.02KB▼ 59.19%
screenshot-4.png8.41KB4.79KB▼ 42.98%
screenshot-1.png7.47KB4.01KB▼ 46.29%