84% cmb2-field-type-font-awesome

Code Review | CMB2 Field Type: Font Awesome

WordPress plugin CMB2 Field Type: Font Awesome scored84%from 54 tests.

About plugin

  • Plugin page: cmb2-field-type-f...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.2
  • WordPress version: 6.3.1
  • First release: Feb 6, 2018
  • Latest release: Jun 30, 2019
  • Number of updates: 8
  • Update frequency: every 63.6 days
  • Top authors: kaisercrazy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /6,103 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.49ms] Passed 4 tests

An overview of server-side resources used by CMB2 Field Type: Font Awesome
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.87 ▼4.45
Dashboard /wp-admin3.31 ▲0.0142.13 ▼7.06
Posts /wp-admin/edit.php3.36 ▲0.0048.39 ▼3.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.57 ▼19.04
Media Library /wp-admin/upload.php3.23 ▲0.0037.26 ▲4.01

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 39 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CMB2 Field Type: Font Awesome
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.181.56 ▼0.3639.98 ▼8.57
Dashboard /wp-admin2,206 ▲185.77 ▼0.11111.91 ▲9.3441.76 ▼1.36
Posts /wp-admin/edit.php2,086 ▼62.00 ▼0.0139.31 ▼3.5736.02 ▲0.00
Add New Post /wp-admin/post-new.php1,542 ▲318.22 ▼4.97633.74 ▼13.9259.84 ▼1.14
Media Library /wp-admin/upload.php1,388 ▼34.27 ▲0.0393.77 ▼6.3139.72 ▼4.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cmb2-field-type-font-awesome/iconselect.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (Selector)
The official readme.txt is a good inspiration

cmb2-field-type-font-awesome/iconselect.php 92% from 13 tests

Analyzing the main PHP file in "CMB2 Field Type: Font Awesome" version 1.4
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cmb2-field-type-font-awesome.php" instead of "iconselect.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected7,303 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
SVG3002,709
CSS90562,335
PHP223132,088
Markdown128090
JavaScript3163860
JSON10021

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.19
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png28.57KB8.58KB▼ 69.96%