84% custom-css-for-pages-and-posts

Code Review | Custom CSS for Pages and Posts

WordPress plugin Custom CSS for Pages and Posts scored84%from 54 tests.

About plugin

  • Plugin page: custom-css-for-pa...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.6.1
  • WordPress version: 6.3.1
  • First release: Sep 20, 2013
  • Latest release: Sep 20, 2013
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: Ahjira (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

700+ active /7,601 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.01MB] [CPU: ▼3.61ms] Passed 4 tests

An overview of server-side resources used by Custom CSS for Pages and Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.82 ▲2.11
Dashboard /wp-admin3.32 ▲0.0248.43 ▼5.56
Posts /wp-admin/edit.php3.38 ▲0.0253.94 ▲3.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0194.12 ▼13.64
Media Library /wp-admin/upload.php3.25 ▲0.0135.42 ▲2.67

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Custom CSS for Pages and Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.33 ▼0.311.81 ▼0.0140.94 ▼2.21
Dashboard /wp-admin2,192 ▲125.55 ▼0.0495.24 ▲6.0641.91 ▼1.09
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0440.02 ▲3.1935.14 ▼1.21
Add New Post /wp-admin/post-new.php6,223 ▲4,69725.83 ▲2.63908.32 ▲266.2457.29 ▼0.03
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.04101.34 ▼9.7244.46 ▼2.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-css-for-pages-and-posts/init.php:22

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: css

custom-css-for-pages-and-posts/init.php 92% from 13 tests

The main PHP file in "Custom CSS for Pages and Posts" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-css-for-pages-and-posts.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1331439

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code1.00
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin