78% sagenda-calendar

Code Review | Sagenda - Scheduling Calendar

WordPress plugin Sagenda - Scheduling Calendar scored78%from 54 tests.

About plugin

  • Plugin page: sagenda-calendar
  • Plugin version: 2.11.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 3, 2018
  • Latest release: Jul 30, 2023
  • Number of updates: 83
  • Update frequency: every 23.8 days
  • Top authors: sagenda (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /33,973 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.20ms] Passed 4 tests

A check of server-side resources used by Sagenda - Scheduling Calendar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.19 ▲1.95
Dashboard /wp-admin3.32 ▼0.0243.49 ▼12.30
Posts /wp-admin/edit.php3.37 ▲0.0144.02 ▼4.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.81 ▼7.92
Media Library /wp-admin/upload.php3.24 ▲0.0133.76 ▲0.01

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 638 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Sagenda - Scheduling Calendar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.78 ▲0.421.94 ▲0.2547.80 ▼0.30
Dashboard /wp-admin2,210 ▲194.84 ▼0.24101.12 ▼3.9040.68 ▲0.72
Posts /wp-admin/edit.php2,096 ▲101.99 ▼0.0139.50 ▲4.1534.59 ▲1.29
Add New Post /wp-admin/post-new.php1,545 ▲918.64 ▼4.51633.67 ▼9.4652.27 ▼1.73
Media Library /wp-admin/upload.php1,392 ▲74.21 ▼0.0394.36 ▼8.5843.83 ▼1.04
Sagenda Calendar /wp-admin/options-general.php?page=Sagenda Calendar8822.0223.1230.46

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sagenda-calendar/initializer.php
    • > /wp-content/plugins/sagenda-calendar/controllers/AdminTokenController.php
    • > /wp-content/plugins/sagenda-calendar/plugin.php
    • > /wp-content/plugins/sagenda-calendar/controllers/CalendarController.php
  • 221× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/Node/Expression/Binary/Less.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_BaseNodeVisitor' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/NodeVisitor/SafeAnalysis.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/TokenParser/Sandbox.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_LoaderInterface' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/Loader/String.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/Node/Expression/Binary/Mul.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/Node/BlockReference.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sagenda-calendar/assets/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/TokenParser/Set.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/TokenParser/For.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/sagenda-calendar/assets/vendor/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
9 plugin tags: reservation, booking form, scheduling, accommodation, booking...

sagenda-calendar/plugin.php 85% from 13 tests

The primary PHP file in "Sagenda - Scheduling Calendar" version 2.11.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("sagenda-calendar.php" instead of "plugin.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 186 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected81,113 lines of code in 537 files:
LanguageFilesBlank linesComment linesLines of code
XML513642,643
PHP31836,98259,74816,476
JSON530011,724
PO File412,2751,6435,030
reStructuredText952,4542,1483,396
C22131821,015
Markdown62020497
CSS4101985
Twig33085
YAML214057
C/C++ Header2192155
m42131246
JavaScript4174

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity7.26
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces24
Interfaces29
Traits2
Classes268
▷ Abstract classes176.34%
▷ Concrete classes25193.66%
▷ Final classes00.00%
Methods1,260
▷ Static methods786.19%
▷ Public methods1,10387.54%
▷ Protected methods12810.16%
▷ Private methods292.30%
Functions103
▷ Named functions7168.93%
▷ Anonymous functions3231.07%
Constants94
▷ Global constants33.19%
▷ Class constants9196.81%
▷ Public constants91100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin