84% post-type-icons

Code Review | Post Type Icons

WordPress plugin Post Type Icons scored84%from 54 tests.

About plugin

  • Plugin page: post-type-icons
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.9
  • WordPress version: 6.3.1
  • First release: Jun 21, 2013
  • Latest release: Apr 25, 2014
  • Number of updates: 17
  • Update frequency: every 18.1 days
  • Top authors: mboynes (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /4,887 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.02MB] [CPU: ▼4.67ms] Passed 4 tests

This is a short check of server-side resources used by Post Type Icons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.01 ▲3.80
Dashboard /wp-admin3.32 ▲0.0254.45 ▼5.09
Posts /wp-admin/edit.php3.37 ▲0.0251.59 ▼0.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.21 ▼13.60
Media Library /wp-admin/upload.php3.24 ▲0.0234.92 ▲0.01
Post Type Icons /wp-admin/tools.php?page=pti3.5433.40

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Post Type Icons: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.37 ▼0.361.78 ▼0.5843.80 ▼0.48
Dashboard /wp-admin2,205 ▲285.56 ▼0.0186.20 ▼15.2039.40 ▼1.96
Posts /wp-admin/edit.php2,107 ▲72.04 ▲0.0241.35 ▲4.1036.78 ▲3.46
Add New Post /wp-admin/post-new.php1,532 ▲423.08 ▲0.08661.56 ▼20.2755.11 ▼16.93
Media Library /wp-admin/upload.php1,407 ▲74.25 ▲0.0495.99 ▼5.6042.19 ▼4.02
Post Type Icons /wp-admin/tools.php?page=pti3,0571.1825.2574.20

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/post-type-icons/post-type-icons.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/post-type-icons/font-awesome/class-pti-font-awesome.php:34

User-side errors Passed 1 test

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

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
6 plugin tags: pizzazz, custom post type, custom post types, icons, ui...

post-type-icons/post-type-icons.php Passed 13 tests

The entry point to "Post Type Icons" version 0.2.2 is a PHP file that has certain tags in its header comment area
49 characters long description:
A simple plugin for setting icons for post types.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,384 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24762970
SVG100414

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 410)
Cyclomatic complexity
Average complexity per logical line of code0.93
Average class complexity211.50
▷ Minimum class complexity6.00
▷ Maximum class complexity417.00
Average method complexity23.16
▷ Minimum method complexity1.00
▷ Maximum method complexity410.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods210.53%
▷ Public methods1789.47%
▷ Protected methods00.00%
▷ Private methods210.53%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin