10% sogo-calendar-widget

Code Review | Sogo Calendar Widget

WordPress plugin Sogo Calendar Widget scored10%from 54 tests.

About plugin

  • Plugin page: sogo-calendar-widget
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.8.9
  • WordPress version: 6.3.1
  • First release: Dec 24, 2015
  • Latest release: Nov 6, 2018
  • Number of updates: 18
  • Update frequency: every 58.3 days
  • Top authors: orenhav (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /3,150 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/sogo-calendar-widget/plugin.php+430
    Function create_function() is deprecated

Server metrics [RAM: ▼1.85MB] [CPU: ▼58.39ms] Passed 4 tests

An overview of server-side resources used by Sogo Calendar Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.314.99 ▼37.54
Dashboard /wp-admin2.17 ▼1.175.43 ▼62.28
Posts /wp-admin/edit.php2.17 ▼1.187.74 ▼41.25
Add New Post /wp-admin/post-new.php2.17 ▼3.726.16 ▼92.50
Media Library /wp-admin/upload.php2.17 ▼1.066.53 ▼29.92

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_sogo_calendar_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Sogo Calendar Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲15713.86 ▼0.418.35 ▲6.7543.74 ▼0.50
Dashboard /wp-admin2,200 ▲265.65 ▲0.1089.09 ▼2.1340.42 ▼1.31
Posts /wp-admin/edit.php2,102 ▲22.01 ▲0.0138.17 ▼0.1334.56 ▼5.22
Add New Post /wp-admin/post-new.php1,528 ▼023.10 ▼0.08656.12 ▼74.6452.36 ▼6.05
Media Library /wp-admin/upload.php1,402 ▲24.09 ▼0.1098.45 ▼4.9343.06 ▼3.27

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/sogo-calendar-widget/plugin.php+430
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_sogo_calendar_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sogo-calendar-widget/plugin.php:30
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sogo-calendar-widget/views/admin.php:3

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: widget, rtl, hebrew, calendar

sogo-calendar-widget/plugin.php 92% from 13 tests

"Sogo Calendar Widget" version 2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sogo-calendar-widget.php" instead of "plugin.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 plugin584 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP28791291
CSS2311198
JavaScript116359
PO File1407536

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods763.64%
▷ Protected methods00.00%
▷ Private methods436.36%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin