68% wp-easy-survey

Code Review | Wp Easy Survey

WordPress plugin Wp Easy Survey scored68%from 54 tests.

About plugin

  • Plugin page: wp-easy-survey
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.6.1
  • WordPress version: 6.3.1
  • First release: Feb 24, 2014
  • Latest release: Sep 30, 2016
  • Number of updates: 10
  • Update frequency: every 95.2 days
  • Top authors: Eoxia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,511 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.77MB] [CPU: ▼3.59ms] Passed 4 tests

A check of server-side resources used by Wp Easy Survey
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7743.74 ▲3.65
Dashboard /wp-admin4.13 ▲0.7850.52 ▼9.31
Posts /wp-admin/edit.php4.18 ▲0.8252.79 ▲0.35
Add New Post /wp-admin/post-new.php6.67 ▲0.7989.59 ▼9.05
Media Library /wp-admin/upload.php3.99 ▲0.7641.38 ▲5.69
New Survey /wp-admin/post-new.php?post_type=wpes_survey4.0546.93
Surveys /wp-admin/edit.php?post_type=wpes_survey4.0341.86

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 204 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
wpes_options

Browser metrics Passed 4 tests

Checking browser requirements for Wp Easy Survey
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,077 ▲31614.79 ▲0.821.90 ▲0.0943.73 ▼0.75
Dashboard /wp-admin2,455 ▲2755.93 ▲0.3289.80 ▼8.8436.63 ▼7.00
Posts /wp-admin/edit.php2,342 ▲2422.26 ▲0.2544.90 ▲2.0937.45 ▼0.05
Add New Post /wp-admin/post-new.php1,592 ▲7523.48 ▲4.81623.81 ▲95.6333.34 ▼12.74
Media Library /wp-admin/upload.php1,704 ▲3044.69 ▲0.4599.10 ▼5.5742.23 ▲0.34
New Survey /wp-admin/post-new.php?post_type=wpes_survey1,7262.9657.6768.27
Surveys /wp-admin/edit.php?post_type=wpes_survey1,3062.4443.1230.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • wpes_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-easy-survey/templates/backend/final-survey-result/html2pdf-styles.css.php
    • > /wp-content/plugins/wp-easy-survey/modules/html2pdf/_tcpdf_5.0.002/fonts/utils/makefont.php
  • 70× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: item in wp-content/plugins/wp-easy-survey/templates/backend/nestable_tree/node.php on line 3
    • > PHP Notice
      Undefined variable: current_evaluation_state in wp-content/plugins/wp-easy-survey/templates/backend/final-survey/export-link.php on line 4
    • > PHP Warning
      Use of undefined constant HTML2PDF_USED_TCPDF_VERSION - assumed 'HTML2PDF_USED_TCPDF_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-easy-survey/modules/html2pdf/_class/myPdf.class.php on line 13
    • > PHP Notice
      Undefined variable: final_survey_id in wp-content/plugins/wp-easy-survey/templates/backend/final-survey/export-link.php on line 3
    • > PHP Notice
      Undefined index: evaluation_id in wp-content/plugins/wp-easy-survey/templates/backend/final-survey-result/view.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-easy-survey/modules/issue.class.php:12
    • > PHP Notice
      Undefined variable: parent_id in wp-content/plugins/wp-easy-survey/templates/backend/nestable_tree/node_container.php on line 1
    • > PHP Notice
      Undefined variable: survey_id in wp-content/plugins/wp-easy-survey/templates/backend/final-survey/export-link.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wp-easy-survey/templates/backend/metabox-association.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-easy-survey/templates/backend/final-survey/answer-waiting.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: survey, evaluation, answer, issues, audit

wp-easy-survey/wp-easy-survey.php 92% from 13 tests

The main PHP file in "Wp Easy Survey" ver. 2.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 170 characters long)

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/wp-easy-survey/modules/html2pdf/_tcpdf_5.0.002/fonts/utils/pfm2afm.exe
      • wp-content/plugins/wp-easy-survey/modules/html2pdf/_tcpdf_5.0.002/fonts/utils/ttf2ufm.exe
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-easy-survey/modules/html2pdf/_tcpdf_5.0.002/tcpdf.crt
152,193 lines of code in 120 files:
LanguageFilesBlank linesComment linesLines of code
PHP1084,01814,506148,331
CSS574292,041
JavaScript5128127992
PO File2338401829

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,477)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 366)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity235.56
▷ Minimum class complexity1.00
▷ Maximum class complexity3,477.00
Average method complexity7.58
▷ Minimum method complexity1.00
▷ Maximum method complexity366.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods967
▷ Static methods30.31%
▷ Public methods53255.02%
▷ Protected methods43144.57%
▷ Private methods40.41%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants211
▷ Global constants20697.63%
▷ Class constants52.37%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/common/medias/ajouter-question.png0.99KB1.04KB0.00%
templates/common/medias/arrow.png0.44KB0.28KB▼ 36.59%
templates/common/medias/dissocier.png0.96KB1.01KB0.00%
templates/common/medias/darkdenim3.png22.07KB24.09KB0.00%
templates/common/medias/no_picture.png0.38KB0.26KB▼ 32.40%