79% custom-sidebars-by-proteusthemes

Code Review | Custom Sidebars by ProteusThemes

WordPress plugin Custom Sidebars by ProteusThemes scored79%from 54 tests.

About plugin

  • Plugin page: custom-sidebars-b...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 22, 2016
  • Latest release: Sep 19, 2022
  • Number of updates: 9
  • Update frequency: every 250.1 days
  • Top authors: capuderg (77.78%)proteusthemes (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /18,775 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 gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.26ms] Passed 4 tests

Server-side resources used by Custom Sidebars by ProteusThemes
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1546.12 ▲4.22
Dashboard /wp-admin3.43 ▲0.0849.54 ▼17.13
Posts /wp-admin/edit.php3.54 ▲0.1952.13 ▲2.65
Add New Post /wp-admin/post-new.php6.01 ▲0.1393.75 ▼9.12
Media Library /wp-admin/upload.php3.35 ▲0.1237.51 ▼1.44

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
pt_cs_modifiable
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Sidebars by ProteusThemes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.25 ▼1.214.45 ▲2.7743.33 ▲3.45
Dashboard /wp-admin2,206 ▲185.81 ▲0.7694.15 ▼11.8539.88 ▼3.70
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0336.29 ▼5.4735.08 ▼0.84
Add New Post /wp-admin/post-new.php6,253 ▲4,73925.97 ▲8.41978.46 ▲316.6457.38 ▲1.63
Media Library /wp-admin/upload.php1,391 ▲34.24 ▲0.0396.54 ▼8.0944.80 ▼2.24

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • pt_cs_modifiable

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/custom-sidebars-by-proteusthemes/custom-sidebars-by-proteusthemes.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: wp_registered_sidebars in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/views/metabox.php on line 13
    • > PHP Warning
      Use of undefined constant PT_CS_PATH - assumed 'PT_CS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/class-pt-cs-main.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/views/widgets-delete.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/class-pt-cs-widgets.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PT_CS_Main' not found in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/views/metabox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/class-pt-cs-editor.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/class-pt-cs-replacer.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/views/widgets-editor.php:18
    • > PHP Warning
      require_once(PT_CS_PATHinc/class-pt-cs-widgets.php): failed to open stream: No such file or directory in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/class-pt-cs-main.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/custom-sidebars-by-proteusthemes/inc/views/widgets.php:23

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: widgets, sidebars, custom, sidebar, personalize...

custom-sidebars-by-proteusthemes/custom-sidebars-by-proteusthemes.php Passed 13 tests

This is the main PHP file of "Custom Sidebars by ProteusThemes" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
84 characters long description:
Allows you to create custom sidebars. Replace sidebars for specific posts and pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin886 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9238611883
JavaScript25262
CSS1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity28.60
▷ Minimum class complexity2.00
▷ Maximum class complexity59.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods52
▷ Static methods2242.31%
▷ Public methods3873.08%
▷ Protected methods917.31%
▷ Private methods59.62%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin