84% cornerstone-custom-icons

Code Review | Cornerstone Custom Icons

WordPress plugin Cornerstone Custom Icons scored 84% from 54 tests.

About plugin

  • Plugin page: cornerstone-custo...
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7
  • WordPress version: 5.9.2
  • First release: Feb 27, 2018
  • Latest release: Mar 13, 2021
  • Number of updates: 28
  • Update frequency: every 39.8 days
  • Top authors: michaelbourne (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active / 4,250 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼298.37ms] Passed 4 tests

Analyzing server-side resources used by Cornerstone Custom Icons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.1751.99 ▲2.05
Dashboard /wp-admin3.53 ▲0.1336.45 ▲4.85
Posts /wp-admin/edit.php3.76 ▲0.1236.98 ▼1.62
Add New Post /wp-admin/post-new.php7.00 ▲0.0393.30 ▼1,192.96
Media Library /wp-admin/upload.php3.41 ▲0.1224.70 ▼0.96
Custom Icons /wp-admin/admin.php?page=cornerstone_icons_settings3.5826.57

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Cornerstone Custom Icons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,772 ▲1816.25 ▲0.285.54 ▼1.162.35 ▼0.57
Dashboard /wp-admin2,903 ▲526.07 ▼0.09115.19 ▼19.77156.45 ▼1.01
Posts /wp-admin/edit.php2,703 ▲93.38 ▲0.1464.03 ▼1.93138.84 ▼4.83
Add New Post /wp-admin/post-new.php1,791 ▲8019.37 ▼1.78384.91 ▼104.32156.03 ▼4.16
Media Library /wp-admin/upload.php1,707 ▲125.58 ▲0.07143.24 ▼1.22186.79 ▼5.30
Custom Icons /wp-admin/admin.php?page=cornerstone_icons_settings1,6962.7553.56151.33

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/cornerstone-custom-icons/uninstall.php+45
    unlink(wp-content/uploads/cornerstone_icons_files/merged-icons-font.css): No such file or directory

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 | 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cornerstone-custom-icons/cornerstone-custom-icons.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: themeco, pro theme, x theme, fontello, images...

cornerstone-custom-icons/cornerstone-custom-icons.php Passed 13 tests

The main PHP script in "Cornerstone Custom Icons" version 0.2.2 is automatically included on every request by WordPress
84 characters long description:
Add custom icon fonts and SVGs to the built in Cornerstone and Pro elements controls

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,575 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5241225659
CSS1733507
SVG14027165
JavaScript1576155
PO File1242489

PHP code Passed 2 tests

An short overview of 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.41
Average class complexity24.67
▷ Minimum class complexity14.00
▷ Maximum class complexity38.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods1666.67%
▷ Protected methods520.83%
▷ Private methods312.50%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/font.png0.30KB0.23KB▼ 23.87%
assets/pp-acceptance-large.png4.31KB2.11KB▼ 50.94%