10% opinionnaire-survey-analysis-report-generator

Code Review | Opinionnaire® Survey analysis and Fast Forum® reports

WordPress plugin Opinionnaire® Survey analysis and Fast Forum® reports scored10%from 54 tests.

About plugin

  • Plugin page: opinionnaire-surv...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2.0
  • WordPress version: 6.3.1
  • First release: Nov 19, 2015
  • Latest release: Apr 24, 2023
  • Number of updates: 95
  • Update frequency: every 28.6 days
  • Top authors: NatDialogue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,550 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+4034
    Undefined variable: opin_db_version

Server metrics [RAM: ▲0.53MB] [CPU: ▲1.04ms] Passed 4 tests

A check of server-side resources used by Opinionnaire® Survey analysis and Fast Forum® reports
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5248.14 ▲8.17
Dashboard /wp-admin3.84 ▲0.5356.90 ▲4.79
Posts /wp-admin/edit.php3.95 ▲0.5953.58 ▲6.32
Add New Post /wp-admin/post-new.php6.42 ▲0.5391.40 ▼5.64
Media Library /wp-admin/upload.php3.76 ▲0.5337.61 ▼1.33
Survey Credentials /wp-admin/admin.php?page=manage-survey-source-credentials3.7039.88
Sample Data /wp-admin/admin.php?page=sample-data3.7235.17
Opinionnaire® /wp-admin/admin.php?page=opinionnaire3.7235.10
SurveyGizmo /wp-admin/admin.php?page=survey-gizmo3.7031.45

Server storage [IO: ▲23.70MB] [DB: ▲1.75MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 310 new files
Database: 4 new tables, 7 new options
New tables
wp_opinionnaire_custom_demographics
wp_opinionnaire_users
wp_opinionnaire_sources
wp_opinionnaire_sample_data
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
opin_db_version
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Opinionnaire® Survey analysis and Fast Forum® reports
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9214.47 ▼0.091.75 ▼0.4744.09 ▼2.84
Dashboard /wp-admin2,247 ▲594.88 ▲0.00111.71 ▲5.8641.13 ▲1.28
Posts /wp-admin/edit.php2,127 ▲382.04 ▼0.0235.16 ▼2.6335.44 ▼3.34
Add New Post /wp-admin/post-new.php1,568 ▲4923.45 ▲0.41663.75 ▲0.5862.73 ▲8.68
Media Library /wp-admin/upload.php1,420 ▲354.14 ▼0.1197.72 ▼6.5941.61 ▼4.77
Survey Credentials /wp-admin/admin.php?page=manage-survey-source-credentials8692.0624.5129.41
Sample Data /wp-admin/admin.php?page=sample-data8462.1225.5726.71
Opinionnaire® /wp-admin/admin.php?page=opinionnaire8611.9925.6434.29
SurveyGizmo /wp-admin/admin.php?page=survey-gizmo8632.0627.0926.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_opinionnaire_sample_data
    • wp_opinionnaire_users
    • wp_opinionnaire_sources
    • wp_opinionnaire_custom_demographics
  • The uninstall procedure has failed, leaving 7 options in the database
    • opin_db_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=manage-survey-source-credentials
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+653
    Undefined variable: inserted
    • > GET request to /wp-admin/admin.php?page=manage-survey-source-credentials
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+653
    Undefined variable: updated
    • > GET request to /wp-admin/admin.php?page=opinionnaire
    • > Warning in wp-content/plugins/opinionnaire-survey-analysis-report-generator/welcome.php+11
    Use of undefined constant CSR_VERSION - assumed 'CSR_VERSION' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Warning in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3854
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+816
    Undefined index: custom_demo_select
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3515
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3514
    Trying to get property 'source_user' of non-object
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3515
    Trying to get property 'source_pass' of non-object
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3515
    Trying to get property 'source_key' of non-object
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3515
    Trying to get property 'source_iv' of non-object
    • > GET request to /wp-admin/admin.php?page=survey-gizmo
    • > Notice in wp-content/plugins/opinionnaire-survey-analysis-report-generator/opinionnaire.php+3522
    Undefined property: stdClass::$total_count

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/opinionnaire-survey-analysis-report-generator/trunk/welcome.php
    • > /wp-content/plugins/opinionnaire-survey-analysis-report-generator/welcome.php
  • 98× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'jpgraph/jpgraph_barcode.php' (include_path='.:/usr/share/php') in wp-content/plugins/opinionnaire-survey-analysis-report-generator/jpgraph/barcode/examples/barcode_ex0.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Plot' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/trunk/jpgraph/jpgraph_stock.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Theme' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/trunk/jpgraph/themes/SoftyTheme.class.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/jpgraph/jpgraph_gantt.php:330
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/jpgraph/jpgraph_canvas.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Theme' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/jpgraph/themes/OceanTheme.class.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Theme' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/trunk/jpgraph/themes/OceanTheme.class.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ImgData' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/trunk/jpgraph/imgdata_pushpins.inc.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Theme' not found in wp-content/plugins/opinionnaire-survey-analysis-report-generator/jpgraph/themes/VividTheme.class.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'jpgraph/jpgraph_barcode.php' (include_path='.:/usr/share/php') in wp-content/plugins/opinionnaire-survey-analysis-report-generator/trunk/jpgraph/barcode/examples/barcode_ex1.php on line 5

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: gizmo, opinionnaire, survey, reports, report generation...

opinionnaire-survey-analysis-report-generator/opinionnaire.php 92% from 13 tests

The main PHP file in "Opinionnaire® Survey analysis and Fast Forum® reports" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("opinionnaire-survey-analysis-report-generator.php" instead of "opinionnaire.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected58,668 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
PHP958,14118,43556,061
JavaScript132381861,916
CSS4820640
Markdown123042
HTML1309

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 150)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity45.01
▷ Minimum class complexity1.00
▷ Maximum class complexity651.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity150.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes334
▷ Abstract classes20.60%
▷ Concrete classes33299.40%
▷ Final classes00.00%
Methods4,016
▷ Static methods801.99%
▷ Public methods4,016100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions88
▷ Named functions8697.73%
▷ Anonymous functions22.27%
Constants1,168
▷ Global constants1,168100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
22 PNG files occupy 1.02MB with 0.71MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/assets/ndn_screen2.png49.45KB13.58KB▼ 72.54%
trunk/assets/NDN_logo_horz_SM.png26.57KB10.53KB▼ 60.36%
assets/screenshot-2.png49.45KB13.58KB▼ 72.54%
trunk/assets/ndn_screen1.png72.53KB21.56KB▼ 70.27%
assets/ndn_screen1.png72.53KB21.56KB▼ 70.27%