84% custom-classes

Code Review | Custom Classes

WordPress plugin Custom Classes scored84%from 54 tests.

About plugin

  • Plugin page: custom-classes
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.8.2
  • WordPress version: 6.3.1
  • First release: Feb 6, 2012
  • Latest release: Sep 27, 2017
  • Number of updates: 3
  • Update frequency: every 688.0 days
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

4,000+ active /24,026 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼10.42ms] Passed 4 tests

This is a short check of server-side resources used by Custom Classes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.03 ▼0.98
Dashboard /wp-admin3.37 ▲0.0348.87 ▼13.46
Posts /wp-admin/edit.php3.49 ▲0.1348.18 ▼1.62
Add New Post /wp-admin/post-new.php5.97 ▲0.0889.07 ▼25.09
Media Library /wp-admin/upload.php3.30 ▲0.0735.79 ▼1.51

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

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

Browser metrics Passed 4 tests

Custom Classes: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.62 ▲1.401.90 ▼2.7643.95 ▼3.64
Dashboard /wp-admin2,198 ▲245.65 ▲0.0986.97 ▼4.6040.45 ▼3.12
Posts /wp-admin/edit.php2,100 ▼32.04 ▼0.0035.69 ▼4.4533.37 ▼10.66
Add New Post /wp-admin/post-new.php6,261 ▲4,71526.11 ▲2.87889.86 ▲279.8854.75 ▲3.79
Media Library /wp-admin/upload.php1,403 ▲34.27 ▲0.07101.05 ▲3.9344.63 ▲2.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Custom_Classes\\add_action() in wp-content/plugins/custom-classes/inc/functions-filters.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Custom_Classes\\trailingslashit() in wp-content/plugins/custom-classes/custom-classes.php:93

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Custom classes meta box), #2 (Body class output in source code)
The official readme.txt is a good inspiration

custom-classes/custom-classes.php Passed 13 tests

The main PHP script in "Custom Classes" version 1.0.0 is automatically included on every request by WordPress
64 characters long description:
Allows users to add custom post and body classes from the admin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin502 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
Markdown4860313
PHP4102296189

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.67
▷ Minimum class complexity3.00
▷ Maximum class complexity11.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes3100.00%
Methods21
▷ Static methods314.29%
▷ Public methods1361.90%
▷ Protected methods00.00%
▷ Private methods838.10%
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

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png8.65KB8.55KB▼ 1.05%
screenshot-1.png12.03KB12.01KB0.13%