77% wordsurvey

Code Review | WordSurvey

WordPress plugin WordSurvey scored77%from 54 tests.

About plugin

  • Plugin page: wordsurvey
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 29, 2016
  • Latest release: Jul 7, 2023
  • Number of updates: 40
  • Update frequency: every 65.7 days
  • Top authors: sersis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,639 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼0.70ms] Passed 4 tests

A check of server-side resources used by WordSurvey
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2043.09 ▼2.98
Dashboard /wp-admin3.50 ▲0.1951.44 ▼3.98
Posts /wp-admin/edit.php3.55 ▲0.1954.21 ▲1.39
Add New Post /wp-admin/post-new.php6.08 ▲0.1999.10 ▲2.77
Media Library /wp-admin/upload.php3.42 ▲0.1938.72 ▲2.82
Add Survey /wp-admin/admin.php?page=wordsurvey/wordsurvey-add.php3.4139.18
WordSurvey /wp-admin/admin.php?page=wordsurvey/wordsurvey-manager.php3.4837.71

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 162 new files
Database: 4 new tables, 7 new options
New tables
wp_wordsurvey_answer
wp_wordsurvey_vote
wp_wordsurvey_question
wp_wordsurvey
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
wrdsrv_surveylimit

Browser metrics Passed 4 tests

An overview of browser requirements for WordSurvey
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲11813.42 ▼0.947.65 ▲5.4640.55 ▼2.66
Dashboard /wp-admin2,225 ▲455.60 ▼0.0790.47 ▼6.2943.41 ▲0.70
Posts /wp-admin/edit.php2,127 ▲271.95 ▼0.0640.22 ▲2.4136.09 ▼1.40
Add New Post /wp-admin/post-new.php1,558 ▲3223.01 ▼0.18634.83 ▼24.1766.44 ▲7.11
Media Library /wp-admin/upload.php1,427 ▲274.21 ▲0.0496.81 ▼0.9243.64 ▼0.88
Add Survey /wp-admin/admin.php?page=wordsurvey/wordsurvey-add.php1,7872.1740.8864.99
WordSurvey /wp-admin/admin.php?page=wordsurvey/wordsurvey-manager.php8511.8126.8929.17

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wordsurvey/lib/tcpdf/tools/tcpdf_addfont.php
    • > /wp-content/plugins/wordsurvey/inc/piegraphstat.php
  • 40× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 for query SELECT sounding_id,sounding_name,sounding_expiration_date FROM wp_wordsurvey WHERE sounding_id =
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphPieGraph.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Graph' not found in wp-content/plugins/wordsurvey/lib/SVGGraph/SVGGraphGridGraph.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: survey, poll builder, customer satisfaction, opinion, survey form...

wordsurvey/wp-wordsurvey.php 85% from 13 tests

Analyzing the main PHP file in "WordSurvey" version 3.2
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wordsurvey.php" instead of "wp-wordsurvey.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected69,479 lines of code in 105 files:
LanguageFilesBlank linesComment linesLines of code
PHP863,31414,26958,312
CSS771307,651
JavaScript77752392,264
INI1321475
PO File2206254449
SVG100288
JSON10040

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 4,349)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 499)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity114.19
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity7.85
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes75
▷ Abstract classes56.67%
▷ Concrete classes7093.33%
▷ Final classes00.00%
Methods1,240
▷ Static methods12910.40%
▷ Public methods69255.81%
▷ Protected methods50941.05%
▷ Private methods393.15%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants110
▷ Global constants110100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected