84% custom-post-styles

Code Review | Custom Post Styles

WordPress plugin Custom Post Styles scored84%from 54 tests.

About plugin

  • Plugin page: custom-post-styles
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5
  • WordPress version: 6.3.1
  • First release: Aug 20, 2016
  • Latest release: Aug 23, 2016
  • Number of updates: 9
  • Update frequency: every 0.3 days
  • Top authors: Cernocky (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /872 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Custom Post Styles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0044.19 ▲2.79
Dashboard /wp-admin3.31 ▲0.0152.64 ▼10.30
Posts /wp-admin/edit.php3.36 ▲0.0055.63 ▲3.12
Add New Post /wp-admin/post-new.php5.89 ▲0.01103.87 ▼3.61
Media Library /wp-admin/upload.php3.23 ▲0.0037.34 ▼10.02

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Styles
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.441.75 ▼0.4343.29 ▼4.31
Dashboard /wp-admin2,198 ▲275.65 ▼0.0290.86 ▼7.6846.27 ▲1.87
Posts /wp-admin/edit.php2,097 ▼32.02 ▼0.0137.83 ▼0.4440.61 ▲4.95
Add New Post /wp-admin/post-new.php1,515 ▼1120.56 ▼2.83671.56 ▼134.6563.39 ▼0.15
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.10109.13 ▼8.8346.84 ▼2.90

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 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 50% from 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
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/custom-post-styles/cps.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Css editor that appears when you editing post.)
The official readme.txt might help

custom-post-styles/cps.php 92% from 13 tests

The main PHP script in "Custom Post Styles" version 1.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-post-styles.php" instead of "cps.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
Good job! No executable or dangerous file extensions detected106 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4283181
SVG10125

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity8.00
▷ Minimum class complexity4.00
▷ Maximum class complexity12.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods8100.00%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
5 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png8.17KB3.15KB▼ 61.47%
assets/banner-1544x500.png44.44KB12.66KB▼ 71.51%
screenshot-1.png22.57KB4.02KB▼ 82.19%
assets/icon-128x128.png3.54KB1.84KB▼ 47.90%
assets/banner-772x250.png18.58KB6.37KB▼ 65.70%