10% context-manager

Code Review | Context Manager

WordPress plugin Context Manager scored10%from 54 tests.

About plugin

  • Plugin page: context-manager
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.7
  • WordPress version: 6.3.1
  • First release: Dec 15, 2012
  • Latest release: Nov 13, 2013
  • Number of updates: 13
  • Update frequency: every 25.8 days
  • Top authors: phill_brown (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active /3,915 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/context-manager/reactions/menu/active-parent.php+3
    Function create_function() is deprecated

Server metrics [RAM: ▼1.89MB] [CPU: ▼59.86ms] Passed 4 tests

This is a short check of server-side resources used by Context Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.375.21 ▼41.04
Dashboard /wp-admin2.12 ▼1.196.03 ▼43.58
Posts /wp-admin/edit.php2.12 ▼1.246.03 ▼42.69
Add New Post /wp-admin/post-new.php2.12 ▼3.777.81 ▼112.12
Media Library /wp-admin/upload.php2.12 ▼1.117.35 ▼30.89
Context Rules /wp-admin/edit.php?post_type=context_rule2.125.77

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

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

Browser metrics Passed 4 tests

Context Manager: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.74 ▲0.391.63 ▼0.0643.43 ▼3.44
Dashboard /wp-admin2,205 ▲315.59 ▼0.0290.60 ▼3.4241.67 ▼1.11
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0140.07 ▲0.6934.85 ▼3.06
Add New Post /wp-admin/post-new.php1,532 ▲623.12 ▼0.65661.05 ▲5.9552.54 ▲2.16
Media Library /wp-admin/upload.php1,407 ▲74.17 ▲0.0297.50 ▼6.0745.97 ▼1.19
Context Rules /wp-admin/edit.php?post_type=context_rule1,0711.9631.0832.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/context-manager/reactions/menu/active-parent.php+3
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=context_rule
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/context-manager/reactions/menu/child-page.php+3
    Function create_function() is deprecated

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
The following issues need your attention
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/context-manager/libs/scb-framework/scb/load.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/context-manager/libs/scb-framework/scb/BoxesPage.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Context_Manager_Reaction' not found in wp-content/plugins/context-manager/reactions/body_class.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/context-manager/reactions/menu/active-parent.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Context_Manager_Reaction' not found in wp-content/plugins/context-manager/reactions/menu.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/context-manager/libs/scb-framework/scb/Widget.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Context_Manager_Reaction' not found in wp-content/plugins/context-manager/reactions/assets.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/context-manager/libs/scb-framework/scb/load.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/context-manager/reactions/menu/active-parent.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/context-manager/libs/scb-framework/scb/Widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
10 plugin tags: widgets, context, widget logic, wp_enqueue_styles, active menu...

context-manager/plugin.php 92% from 13 tests

The entry point to "Context Manager" version 1.2.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("context-manager.php" instead of "plugin.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
No dangerous file extensions were detected3,195 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP309084892,718
CSS21013454
JavaScript311023

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.87
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes722.58%
▷ Concrete classes2477.42%
▷ Final classes00.00%
Methods223
▷ Static methods8035.87%
▷ Public methods18482.51%
▷ Protected methods94.04%
▷ Private methods3013.45%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
libs/pb-framework/assets/vendor/chosen/chosen-sprite.png1.52KB0.70KB▼ 54.36%