89% custom-css-for-pages

Code Review | Custom CSS for pages

WordPress plugin Custom CSS for pages scored89%from 54 tests.

About plugin

  • Plugin page: custom-css-for-pages
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Jun 30, 2016
  • Latest release: Jun 30, 2016
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: farvehandleren (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,113 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.35ms] Passed 4 tests

Analyzing server-side resources used by Custom CSS for pages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.19 ▲1.84
Dashboard /wp-admin3.32 ▼0.0348.66 ▼14.11
Posts /wp-admin/edit.php3.37 ▲0.0146.23 ▼6.99
Add New Post /wp-admin/post-new.php5.90 ▲0.0294.51 ▼3.44
Media Library /wp-admin/upload.php3.24 ▲0.0136.84 ▼0.84

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Custom CSS for pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲5713.62 ▼0.774.51 ▲2.9742.66 ▲3.98
Dashboard /wp-admin2,211 ▲234.90 ▼0.00104.16 ▼2.3245.33 ▲2.92
Posts /wp-admin/edit.php2,070 ▼222.01 ▲0.0233.70 ▼7.5131.34 ▼5.82
Add New Post /wp-admin/post-new.php6,227 ▲4,71319.02 ▲1.55874.76 ▲192.8866.96 ▲14.45
Media Library /wp-admin/upload.php1,390 ▲84.23 ▲0.0395.91 ▲0.0242.25 ▼3.66

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: pages, css, post custom css, custom css, custom

custom-css-for-pages/ri_cc.php 85% from 13 tests

The primary PHP file in "Custom CSS for pages" version 1.0 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 ("custom-css-for-pages.php" instead of "ri_cc.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 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 detected73 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2202058
CSS10015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin