78% pg-context-sidebar

Code Review | PG Context Sidebar

WordPress plugin PG Context Sidebar scored78%from 54 tests.

About plugin

  • Plugin page: pg-context-sidebar
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.6.2
  • WordPress version: 6.3.1
  • First release: May 14, 2012
  • Latest release: Mar 24, 2021
  • Number of updates: 21
  • Update frequency: every 154.1 days
  • Top authors: peoplesgeek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /6,549 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
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by PG Context Sidebar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0947.57 ▲3.31
Dashboard /wp-admin3.42 ▲0.1153.27 ▼2.36
Posts /wp-admin/edit.php3.53 ▲0.1748.55 ▼11.54
Add New Post /wp-admin/post-new.php6.02 ▲0.1390.39 ▼16.76
Media Library /wp-admin/upload.php3.34 ▲0.1148.58 ▲11.05
PG Context Sidebar /wp-admin/options-general.php?page=pg-context-sidebar/pg-context-sidebar.php3.2933.14

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_pgeek_cs_widget
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
pgeek_cs_options
pgeek_cs_option_ver
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for PG Context Sidebar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.24 ▼0.322.28 ▲0.4551.42 ▲1.05
Dashboard /wp-admin2,197 ▲205.65 ▲0.1386.81 ▼6.7440.14 ▼3.07
Posts /wp-admin/edit.php2,121 ▲212.01 ▲0.0259.69 ▲22.7842.26 ▲6.00
Add New Post /wp-admin/post-new.php6,317 ▲4,78918.95 ▼4.14914.76 ▲245.9354.03 ▼0.47
Media Library /wp-admin/upload.php1,411 ▲174.25 ▲0.05104.41 ▼32.3044.35 ▼9.49
PG Context Sidebar /wp-admin/options-general.php?page=pg-context-sidebar/pg-context-sidebar.php8822.0524.3630.72

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_pgeek_cs_widget
    • pgeek_cs_options
    • theysaidso_admin_options
    • db_upgraded
    • pgeek_cs_option_ver
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=pg-context-sidebar/pg-context-sidebar.php
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=pg-context-sidebar/pg-context-sidebar.php
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/pg-context-sidebar/pg-context-sidebar.php:35

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Shows new fields for your sidebar content on the post page), #2 (Shows the resulting content in the sidebar for the page), #3 (Shows the ability to select the page or post types that allow context sensitive content)
The official readme.txt might help

pg-context-sidebar/pg-context-sidebar.php 92% from 13 tests

"PG Context Sidebar" version 2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin607 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP28966356
PO File14444168
JavaScript15042
CSS14041

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.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
4 PNG files occupy 0.42MB with 0.19MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png19.97KB9.90KB▼ 50.40%
screenshot-2.png356.34KB139.96KB▼ 60.72%
screenshot-1.png54.54KB25.32KB▼ 53.58%
images/pg-cs-status-sprite.png2.73KB2.26KB▼ 17.19%