71% styles

Code Review | Styles

WordPress plugin Styles scored 71% from 53 tests.

About plugin

  • Plugin page: styles
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.8
  • WordPress version: 5.8.1
  • First release: Feb 22, 2012
  • Latest release: Jun 23, 2021
  • Number of updates: 113
  • Update frequency: every 30.5 days
  • Top authors: pdclark (74.34%)brainstormmedia (26.55%)

Code review

53 tests

User reviews

33 reviews

Install metrics

10,000+ active / 246,591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼262.04ms] Passed 4 tests

Analyzing server-side resources used by Styles
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.9839.67 ▲19.38
Dashboard /wp-admin3.30 ▲0.2556.07 ▲15.64
Posts /wp-admin/edit.php3.35 ▲0.2545.50 ▲1.79
Add New Post /wp-admin/post-new.php5.61 ▲0.1893.60 ▼1,060.93
Media Library /wp-admin/upload.php3.18 ▲0.1832.42 ▼4.67
Styles /wp-admin/options-general.php?page=styles3.1631.31

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 718 new files
Database: no new tables, 2 new options
New WordPress options
storm-styles-twentytwentyone-css
storm-styles

Browser metrics Passed 4 tests

Checking browser requirements for Styles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,685 ▲7915.88 ▲0.379.62 ▲0.9250.29 ▲4.85
Dashboard /wp-admin2,937 ▲845.89 ▲0.05140.93 ▲4.61100.16 ▼2.21
Posts /wp-admin/edit.php2,713 ▲72.68 ▼0.0060.39 ▼2.0290.06 ▼3.94
Add New Post /wp-admin/post-new.php1,858 ▲519.12 ▼0.05365.07 ▼6.50102.75 ▼6.44
Media Library /wp-admin/upload.php1,782 ▲105.02 ▲0.03155.24 ▼8.86109.94 ▼19.98
Styles /wp-admin/options-general.php?page=styles1,0612.0956.1375.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • storm-styles-twentytwentyone-css

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=styles
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=styles
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% 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 fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/styles/views/licenses.php
    • > /wp-content/plugins/styles/views/setting-heading.php
    • > /wp-content/plugins/styles/views/setting-select.php
    • > /wp-content/plugins/styles/classes/csstidy/css_optimiser.php
    • > /wp-content/plugins/styles/views/setting-radio.php
  • 53× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/styles/classes/styles-font-menu/views/menu.php:3
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/styles/classes/csstidy/css_optimiser.php on line 140
    • > PHP Notice
      Undefined variable: class in wp-content/plugins/styles/views/setting-hidden.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Styles_Control' not found in wp-content/plugins/styles/classes/styles-control-color.php:3
    • > PHP Notice
      Undefined variable: class in wp-content/plugins/styles/views/setting-textarea.php on line 1
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/styles/views/setting-textarea.php on line 1
    • > PHP Notice
      Undefined variable: description in wp-content/plugins/styles/views/setting-select.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/styles/views/admin-options.php:3
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/styles/views/setting-hidden.php on line 1
    • > PHP Notice
      Undefined variable: class in wp-content/plugins/styles/views/setting-password.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
Attributes that require attention:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4 in styles/assets to your readme.txt
The official readme.txt is a good inspiration

styles/styles.php 92% from 13 tests

The main PHP script in "Styles" version 1.2.3 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 238 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected8,654 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
PHP531,6502,7166,678
JavaScript9170461,223
CSS75684567
Markdown2630125
JSON20046
YAML14015

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 153)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity27.82
▷ Minimum class complexity1.00
▷ Maximum class complexity286.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity153.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes25.26%
▷ Concrete classes3694.74%
▷ Final classes00.00%
Methods344
▷ Static methods123.49%
▷ Public methods33797.97%
▷ Protected methods30.87%
▷ Private methods41.16%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants22
▷ Global constants1777.27%
▷ Class constants522.73%
▷ Public constants5100.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
633 PNG files occupy 1.22MB with 0.61MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
classes/styles-font-menu/styles-fonts/png/monsieurladoulaise-regular.png3.75KB1.94KB▼ 48.24%
classes/styles-font-menu/styles-fonts/png/vidaloka-regular.png1.64KB0.87KB▼ 47.11%
classes/styles-font-menu/styles-fonts/png/imfelldwpicasc-regular.png3.13KB1.57KB▼ 49.98%
classes/styles-font-menu/styles-fonts/png/sanchez-regular.png1.79KB0.84KB▼ 52.90%
classes/styles-font-menu/styles-fonts/png/bangers-regular.png2.17KB1.08KB▼ 50.18%