78% content-sections

Code Review | Content Sections

WordPress plugin Content Sections scored78%from 54 tests.

About plugin

  • Plugin page: content-sections
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Jan 29, 2013
  • Latest release: Jan 29, 2013
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: beatpanda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.44ms] Passed 4 tests

Analyzing server-side resources used by Content Sections
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.97 ▲0.77
Dashboard /wp-admin3.35 ▲0.0448.37 ▼4.45
Posts /wp-admin/edit.php3.46 ▲0.1150.69 ▲2.50
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.82 ▼20.58
Media Library /wp-admin/upload.php3.27 ▲0.0442.72 ▲11.43

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Content Sections
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.15 ▼0.232.00 ▼0.0046.19 ▲7.68
Dashboard /wp-admin2,192 ▲155.62 ▲0.0193.35 ▲2.8237.18 ▼6.52
Posts /wp-admin/edit.php2,097 ▼02.03 ▲0.0739.55 ▲3.4935.19 ▲1.60
Add New Post /wp-admin/post-new.php1,531 ▲323.08 ▼0.17645.24 ▼5.6756.65 ▼1.74
Media Library /wp-admin/upload.php1,397 ▼64.23 ▲0.0497.68 ▲0.1146.34 ▲0.17

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/content-sections/views/content-section-toc.php
    • > /wp-content/plugins/content-sections/views/content-section-anchor.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: namespace in wp-content/plugins/content-sections/views/options.php on line 10
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/content-sections/views/content-section-anchor.php on line 1
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/content-sections/init.php on line 29
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/content-sections/views/content-section-anchor.php on line 1
    • > PHP Notice
      Undefined variable: namespace in wp-content/plugins/content-sections/views/options.php on line 1
    • > PHP Notice
      Undefined variable: content in wp-content/plugins/content-sections/views/content-section-anchor.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/content-sections/views/content-section-toc.php on line 2
    • > PHP Notice
      Undefined variable: page_title in wp-content/plugins/content-sections/views/options.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/content-sections/init.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/content-sections/views/options.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: comments, spam

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

The entry point to "Content Sections" version 0.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 236 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("content-sections.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
There were no executable files found in this plugin287 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP772240284
JavaScript22133
CSS1060

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.00
▷ Minimum class complexity11.00
▷ Maximum class complexity15.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods416.00%
▷ Public methods2496.00%
▷ Protected methods00.00%
▷ Private methods14.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin