72% sagenda

Code Review | Sagenda - Scheduling List - LEGACY

WordPress plugin Sagenda - Scheduling List - LEGACY scored72%from 54 tests.

About plugin

  • Plugin page: sagenda
  • Plugin version: 1.3.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 18, 2014
  • Latest release: Jan 22, 2023
  • Number of updates: 167
  • Update frequency: every 18.6 days
  • Top authors: sagenda (100%)

Code review

54 tests

User reviews

49 reviews

Install metrics

500+ active /87,015 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.71ms] Passed 4 tests

An overview of server-side resources used by Sagenda - Scheduling List - LEGACY
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.16 ▼1.84
Dashboard /wp-admin3.32 ▲0.0246.28 ▼6.47
Posts /wp-admin/edit.php3.37 ▲0.0247.72 ▼5.20
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.41 ▼9.33
Media Library /wp-admin/upload.php3.25 ▲0.0234.65 ▼1.62
Sagenda /wp-admin/options-general.php?page=Sagenda3.5031.24

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 1,479 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Sagenda - Scheduling List - LEGACY
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,197 ▲46214.38 ▼0.0624.55 ▲22.8238.18 ▼4.81
Dashboard /wp-admin2,222 ▲305.85 ▲0.9097.62 ▼9.6638.68 ▼8.67
Posts /wp-admin/edit.php2,104 ▲122.04 ▲0.0140.36 ▼2.8637.14 ▼0.68
Add New Post /wp-admin/post-new.php1,550 ▲3623.16 ▲5.44661.34 ▼10.0964.76 ▲7.48
Media Library /wp-admin/upload.php1,401 ▲164.22 ▼0.0896.22 ▼0.9942.24 ▼1.03
Sagenda /wp-admin/options-general.php?page=Sagenda8632.0525.4229.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=Sagenda
    • > User deprecated in wp-content/plugins/sagenda/assets/vendor/twig/lib/Twig/Autoloader.php+12
    The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.
    • > GET request to /wp-admin/options-general.php?page=Sagenda
    • > User deprecated in wp-content/plugins/sagenda/assets/vendor/twig/lib/Twig/Autoloader.php+30
    Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.
    • > GET request to /wp-admin/options-general.php?page=Sagenda
    • > Notice in wp-content/plugins/sagenda/webservices/SagendaAPI.php+52
    Undefined property: stdClass::$Message

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sagenda/controllers/CalendarController.php
    • > /wp-content/plugins/sagenda/initializer.php
    • > /wp-content/plugins/sagenda/controllers/AdminTokenController.php
    • > /wp-content/plugins/sagenda/assets/phpunit-6.1/tests/TextUI/_files/phpt_external.php
    • > /wp-content/plugins/sagenda/controllers/SearchController.php
    • > /wp-content/plugins/sagenda/plugin.php
  • 513× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sagenda/assets/vendor/symfony/phpunit-bridge/Tests/ClockMockTest.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/sagenda/assets/vendor/twig/src/Node/Expression/Binary/EqualBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sagenda/assets/phpunit-6.1/tests/_files/IgnoreCodeCoverageClassTest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sagenda/assets/phpunit-6.1/tests/Regression/Trac/783/OneTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sagenda/assets/phpunit-6.1/tests/_files/DataProviderFilterTest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/sagenda/assets/phpunit-6.1/tests/Regression/GitHub/1149/Issue1149Test.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extensions_Grammar' not found in wp-content/plugins/sagenda/assets/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Switch.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Runner\\BaseTestRunner' not found in wp-content/plugins/sagenda/assets/phpunit-6.1/src/TextUI/TestRunner.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/sagenda/assets/vendor/mashape/unirest-php/tests/Unirest/ResponseTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_CompilerInterface' not found in wp-content/plugins/sagenda/assets/vendor/twig/src/Compiler.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

sagenda/plugin.php 85% from 13 tests

The main PHP file in "Sagenda - Scheduling List - LEGACY" ver. 1.3.8 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 186 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sagenda.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected92,061 lines of code in 1,370 files:
LanguageFilesBlank linesComment linesLines of code
PHP98911,69917,79948,128
JavaScript1096,4845,44625,902
PO File382,1231,5234,805
reStructuredText1022,6792,3783,644
CSS17672333,276
Markdown351,19402,098
C22231941,083
JSON1300737
LESS11274273572
XML30350483
Ant1650367
Twig8474293
XSD100267
YAML6320155
HTML35328107
C/C++ Header2192155
m42131246
Bourne Shell16143

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 127)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.09
▷ Minimum class complexity1.00
▷ Maximum class complexity216.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity127.00
Code structure
Namespaces63
Interfaces41
Traits3
Classes789
▷ Abstract classes283.55%
▷ Concrete classes76196.45%
▷ Final classes30.39%
Methods3,397
▷ Static methods38811.42%
▷ Public methods2,90885.60%
▷ Protected methods35910.57%
▷ Private methods1303.83%
Functions268
▷ Named functions22282.84%
▷ Anonymous functions4617.16%
Constants154
▷ Global constants42.60%
▷ Class constants15097.40%
▷ Public constants150100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected