84% custom-sections

Code Review | Custom Sections

WordPress plugin Custom Sections scored 84% from 54 tests.

About plugin

  • Plugin page: custom-sections
  • Plugin version: 0.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.7.2
  • WordPress version: 5.8.1
  • First release: Feb 1, 2013
  • Latest release: Dec 7, 2016
  • Number of updates: 26
  • Update frequency: every 56.2 days
  • Top authors: jvwissen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,995 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.11MB] [CPU: ▼150.34ms] Passed 4 tests

An overview of server-side resources used by Custom Sections
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1338.10 ▲14.58
Dashboard /wp-admin3.08 ▲0.0340.21 ▼3.46
Posts /wp-admin/edit.php3.04 ▼0.0731.35 ▼14.83
Add New Post /wp-admin/post-new.php4.99 ▼0.4477.20 ▼582.72
Media Library /wp-admin/upload.php3.03 ▲0.0333.25 ▼0.35
Custom Sections /wp-admin/options-general.php?page=sections3.0028.48

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

Custom Sections: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲11715.96 ▲0.048.28 ▼1.2246.69 ▼4.96
Dashboard /wp-admin3,002 ▲715.89 ▼0.07137.67 ▼23.32113.40 ▼1.51
Posts /wp-admin/edit.php2,749 ▲102.71 ▲0.0362.93 ▼4.2889.10 ▲0.63
Add New Post /wp-admin/post-new.php3,727 ▲2,05714.94 ▼4.19446.12 ▲65.25113.79 ▲2.53
Media Library /wp-admin/upload.php1,817 ▲105.03 ▲0.03151.62 ▼12.20117.63 ▼13.18
Custom Sections /wp-admin/options-general.php?page=sections1,0702.3357.6281.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_customsections-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_title() in wp-content/plugins/custom-sections/templates/section-default.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-sections/classes/class-custom-sections-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-sections/admin/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/custom-sections/admin/popup.php:3
    • > PHP Notice
      Undefined index: post_ID in wp-content/plugins/custom-sections/admin/shortcode.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-sections/classes/class-custom-sections.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/custom-sections/admin/shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-sections/admin/widget-options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: posttype, widgets

custom-sections/init.php 85% from 13 tests

The main PHP script in "Custom Sections" version 0.4.8 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-sections.php" instead of "init.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 180 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin459 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity24.00
▷ Minimum class complexity10.00
▷ Maximum class complexity38.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods623.08%
▷ Public methods2492.31%
▷ Protected methods27.69%
▷ Private methods00.00%
▷ Named functions2100.00%
▷ Anonymous functions00.00%
▷ Global constants2100.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
There are no PNG files in this plugin