52% demovox

Code Review | demovox

WordPress plugin demovox scored52%from 54 tests.

About plugin

  • Plugin page: demovox
  • Plugin version: 2.6.1
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 6.3.1
  • First release: Jun 12, 2019
  • Latest release: Feb 25, 2022
  • Number of updates: 38
  • Update frequency: every 26.7 days
  • Top authors: spschweiz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,566 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.37MB] [CPU: ▲12.60ms] Passed 4 tests

Analyzing server-side resources used by demovox
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.27 ▲0.8055.42 ▲17.72
Dashboard /wp-admin4.93 ▲1.5878.36 ▲17.98
Posts /wp-admin/edit.php4.99 ▲1.6274.75 ▲30.33
Add New Post /wp-admin/post-new.php7.45 ▲1.5697.77 ▲0.24
Media Library /wp-admin/upload.php4.77 ▲1.5349.18 ▲14.45
Signatures Data /wp-admin/admin.php?page=demovoxData4.8158.68
System info /wp-admin/admin.php?page=demovoxSysinfo4.9057.63
Import /wp-admin/admin.php?page=demovoxImport4.7650.50
Settings /wp-admin/admin.php?page=demovoxSettings4.7650.99
demovox /wp-admin/admin.php?page=demovox4.7650.57

Server storage [IO: ▲3.75MB] [DB: ▲0.02MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • The plugin illegally modified 1 file (39.78KB) outside of "wp-content/plugins/demovox/" and "wp-content/uploads/"
    • (new file) wp-content/debug.demovox.php
Filesystem: 400 new files
Database: 2 new tables, 205 new options
New tables
wp_demovox_mails
wp_demovox_signatures
New WordPress options
demovox_field_birthdate_day_rm_y
demovox_mail_from_name_fr
demovox_fontsize
demovox_field_birthdate_year_fr_y
demovox_cron_mail_remind_sheet_statusSuccess
demovox_field_qr_img_de_rot
demovox_mail_from_name_rm
demovox_mail_remind_sheet_enabled
demovox_swiss_abroad_allow
demovox_field_qr_text_rm_y
...

Browser metrics Passed 4 tests

Checking browser requirements for demovox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲33219.57 ▲4.8427.39 ▲25.8946.99 ▲4.49
Dashboard /wp-admin2,378 ▲2018.19 ▲2.62121.83 ▲38.8240.35 ▼4.54
Posts /wp-admin/edit.php2,309 ▲2125.78 ▲3.8172.16 ▲37.3840.04 ▲4.61
Add New Post /wp-admin/post-new.php1,486 ▼4022.43 ▼1.33531.95 ▼131.0830.07 ▼19.43
Media Library /wp-admin/upload.php1,446 ▲465.82 ▲1.5795.13 ▼3.9739.67 ▼5.12
Signatures Data /wp-admin/admin.php?page=demovoxData1,4505.5356.6133.44
System info /wp-admin/admin.php?page=demovoxSysinfo1,3325.4554.3538.81
Import /wp-admin/admin.php?page=demovoxImport1,1095.4553.7926.12
Settings /wp-admin/admin.php?page=demovoxSettings1,1695.4754.6230.00
demovox /wp-admin/admin.php?page=demovox1,0545.4769.9631.65

Uninstaller [IO: ▲0.04MB] [DB: ▲0.02MB] 25% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/demovox/includes/Core.php+247
    Array to string conversion
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_demovox_mails
    • wp_demovox_signatures
  • The uninstall procedure has failed, leaving 205 options in the database
    • demovox_is_language_enabled_fr
    • demovox_mail_smtp_port
    • demovox_mail_from_name_de
    • demovox_field_street_it_y
    • demovox_api_address_gde_input
    • demovox_mail_method
    • demovox_field_qr_img_fr_x
    • demovox_drop_config_on_uninstall
    • demovox_field_qr_img_size_de
    • demovox_field_qr_img_rm_x
    • ...

Smoke tests 25% 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
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/demovox/demovox.php
    • > /wp-content/plugins/demovox/admin/partials/statsSource.php
    • > /wp-content/plugins/demovox/admin/partials/statsCharts.php
    • > /wp-content/plugins/demovox/admin/partials/sysinfo-encrypt.php
  • 73× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Demovox\\CronBase' not found in wp-content/plugins/demovox/includes/cron/CronMailBase.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Demovox\\submit_button() in wp-content/plugins/demovox/admin/partials-settings/settings-2.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Demovox\\ManageCron' not found in wp-content/plugins/demovox/admin/partials/sysinfo.php:115
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Demovox\\__() in wp-content/plugins/demovox/public/partials/sign-3.php:29
    • > PHP Notice
      Undefined variable: source in wp-content/plugins/demovox/admin/partials/statsCharts.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Demovox\\Infos' not found in wp-content/plugins/demovox/public/partials/sign-1.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Demovox\\Db' not found in wp-content/plugins/demovox/includes/db/DbSignatures.php:5
    • > PHP Warning
      require_once(lib/byte_safe_strings.php): failed to open stream: No such file or directory in wp-content/plugins/demovox/libs/composer/paragonie/random_compat/psalm-autoload.php on line 3
    • > PHP Notice
      Undefined variable: hashKey in wp-content/plugins/demovox/admin/partials/sysinfo.php on line 34
    • > PHP Fatal error
      Uncaught Error: Interface 'Hashids\\Math\\MathInterface' not found in wp-content/plugins/demovox/libs/composer/hashids/hashids/src/Math/Gmp.php:21

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=demovox
    • > Network (severe)
    https://www.sp-ps.ch/sites/all/themes/sp_ps/logo.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: referendum, switzerland, initiative, signature, signatures...

demovox/demovox.php Passed 13 tests

The primary PHP file in "demovox" version 2.6.1 is used by WordPress to initiate all plugin functionality
125 characters long description:
demovox is a tool to collect signatures for Swiss popular initiatives by offering the visitor a personalized signature sheet.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin42,465 lines of code in 369 files:
LanguageFilesBlank linesComment linesLines of code
PHP2201,1012,95541,573
JSON13700542
JavaScript32228162
Markdown2370126
XML20032
make19424
Bourne Shell1203
CSS3003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.50
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces7
Interfaces2
Traits0
Classes56
▷ Abstract classes00.00%
▷ Concrete classes56100.00%
▷ Final classes712.50%
Methods396
▷ Static methods15539.14%
▷ Public methods30978.03%
▷ Protected methods6215.66%
▷ Private methods256.31%
Functions10
▷ Named functions660.00%
▷ Anonymous functions440.00%
Constants52
▷ Global constants23.85%
▷ Class constants5096.15%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin