84% css-file-selector

Code Review | CSS File Selector

WordPress plugin CSS File Selector scored84%from 54 tests.

About plugin

  • Plugin page: css-file-selector
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Dec 24, 2014
  • Latest release: Jan 8, 2015
  • Number of updates: 20
  • Update frequency: every 0.8 days
  • Top authors: Chrgiga (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /2,697 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 gracefully, with no errors

Server metrics [RAM: ▼0.67MB] [CPU: ▼16.62ms] Passed 4 tests

A check of server-side resources used by CSS File Selector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.27 ▼3.16
Dashboard /wp-admin3.34 ▲0.0345.50 ▼6.60
Posts /wp-admin/edit.php3.39 ▲0.0346.93 ▼4.08
Add New Post /wp-admin/post-new.php3.13 ▼2.7736.84 ▼52.65
Media Library /wp-admin/upload.php3.26 ▲0.0334.18 ▲0.60

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for CSS File Selector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.44 ▲0.201.64 ▲0.1038.36 ▲0.13
Dashboard /wp-admin2,210 ▲225.88 ▲0.98109.73 ▼4.6237.27 ▼8.75
Posts /wp-admin/edit.php2,093 ▲12.03 ▼0.0242.33 ▲1.5634.76 ▼1.52
Add New Post /wp-admin/post-new.php1,578 ▲6420.61 ▲3.07655.68 ▼33.6965.26 ▲9.70
Media Library /wp-admin/upload.php1,395 ▲74.17 ▼0.12105.96 ▼5.4644.79 ▼2.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/css-file-selector/cssfileselector.php:181

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: post, file css, css, page, custom css

css-file-selector/cssfileselector.php 92% from 13 tests

The primary PHP file in "CSS File Selector" version 1.0.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("css-file-selector.php" instead of "cssfileselector.php")

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
There were no executable files found in this plugin196 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22533148
JavaScript17143
CSS1005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin