93% stilus

Code Review | Stilus

WordPress plugin Stilus scored 93% from 54 tests.

About plugin

  • Plugin page: stilus
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 5.8.1
  • First release: Feb 26, 2016
  • Latest release: Jan 28, 2019
  • Number of updates: 26
  • Update frequency: every 41.0 days
  • Top authors: mystilus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 4,200 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼148.75ms] Passed 4 tests

An overview of server-side resources used by Stilus
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0523.47 ▼0.98
Dashboard /wp-admin3.12 ▲0.0533.73 ▼4.13
Posts /wp-admin/edit.php3.20 ▲0.0931.23 ▼11.58
Add New Post /wp-admin/post-new.php5.48 ▲0.0470.27 ▼578.32
Media Library /wp-admin/upload.php3.06 ▲0.0523.74 ▲1.39
Stilus /wp-admin/options-general.php?page=st_settings3.0320.34

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Stilus: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,693 ▲9215.56 ▼0.445.11 ▼3.3477.08 ▼2.50
Dashboard /wp-admin2,955 ▲606.13 ▼0.05115.98 ▼18.42184.15 ▲12.02
Posts /wp-admin/edit.php2,738 ▼23.11 ▼0.1272.53 ▲9.98143.71 ▲2.89
Add New Post /wp-admin/post-new.php3,711 ▲715.11 ▼3.65422.87 ▼16.94171.99 ▲1.39
Media Library /wp-admin/upload.php1,781 ▲295.57 ▲0.08133.79 ▼10.81208.93 ▲27.72
Stilus /wp-admin/options-general.php?page=st_settings1,1032.3853.58114.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/stilus/stilus.php
    • > /wp-content/plugins/stilus/inc/templates/loading.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Please a description for screenshot #1 in stilus/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt might help

stilus/stilus.php 85% from 13 tests

"Stilus" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Description: Please don't use more than 140 characters for the plugin description (currently 143 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected339 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP876114283
JavaScript1111156

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods419.05%
▷ Public methods2095.24%
▷ Protected methods00.00%
▷ Private methods14.76%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
7 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/loading2.png1.45KB0.72KB▼ 50.24%
img/loading3.png1.43KB0.71KB▼ 50.14%
img/loading4.png1.43KB0.71KB▼ 50.10%
img/loading5.png1.42KB0.69KB▼ 51.20%
img/loading0.png1.38KB0.68KB▼ 51.16%