72% gg-polls

Code Review | GG Polls

WordPress plugin GG Polls scored72%from 54 tests.

About plugin

  • Plugin page: gg-polls
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Sep 20, 2019
  • Number of updates: 31
  • Update frequency: every 4.9 days
  • Top authors: simplydemon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,308 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.36MB] [CPU: ▼17.94ms] Passed 4 tests

A check of server-side resources used by GG Polls
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3239.30 ▼1.08
Dashboard /wp-admin3.70 ▲0.3554.91 ▼12.22
Posts /wp-admin/edit.php3.77 ▲0.4151.98 ▲10.57
Add New Post /wp-admin/post-new.php3.49 ▼2.4038.05 ▼62.01
Media Library /wp-admin/upload.php3.54 ▲0.3134.30 ▲3.57
Variants /wp-admin/edit.php?post_type=ns_gg_variant3.6340.47
Pairs /wp-admin/edit.php?post_type=ns_gg_pair3.6338.72
Create new poll /wp-admin/admin.php?page=ns-polls3.6038.94
Polls /wp-admin/edit.php?post_type=ns_gg_poll3.6343.41

Server storage [IO: ▲1.10MB] [DB: ▲0.01MB] Passed 3 tests

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

Browser metrics Passed 4 tests

GG Polls: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲24514.63 ▲0.281.80 ▲0.1743.98 ▼7.46
Dashboard /wp-admin2,380 ▲2036.14 ▲0.46106.42 ▲14.4338.13 ▲0.68
Posts /wp-admin/edit.php2,305 ▲2053.37 ▲1.3544.10 ▲4.1633.02 ▼5.59
Add New Post /wp-admin/post-new.php1,564 ▲2723.07 ▲5.16660.11 ▲30.5536.60 ▼32.78
Media Library /wp-admin/upload.php1,445 ▲484.16 ▼0.0477.63 ▼22.1440.09 ▲0.13
Polls settings /wp-admin/ns-poll-settings.php260.420.0714.00
Variants /wp-admin/edit.php?post_type=ns_gg_variant1,2783.3941.8327.78
Pairs /wp-admin/edit.php?post_type=ns_gg_pair1,2783.2345.1126.73
Create new poll /wp-admin/admin.php?page=ns-polls1,6633.7349.1266.85
Polls /wp-admin/edit.php?post_type=ns_gg_poll1,2783.3342.9026.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

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
Please fix the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gg-polls/template-parts/forms/text.php
    • > /wp-content/plugins/gg-polls/template-parts/forms/checkbox.php
    • > /wp-content/plugins/gg-polls/template-parts/forms/select.php
    • > /wp-content/plugins/gg-polls/template-parts/forms/textarea.php
  • 35× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: fieldName in wp-content/plugins/gg-polls/template-parts/forms/textarea.php on line 3
    • > PHP Notice
      Undefined variable: h in wp-content/plugins/gg-polls/template-parts/forms/img.php on line 3
    • > PHP Notice
      Undefined variable: w in wp-content/plugins/gg-polls/template-parts/forms/img.php on line 3
    • > PHP Notice
      Undefined variable: fieldID in wp-content/plugins/gg-polls/template-parts/forms/textarea.php on line 1
    • > PHP Notice
      Undefined variable: fieldTitle in wp-content/plugins/gg-polls/template-parts/forms/select.php on line 1
    • > PHP Notice
      Undefined variable: fieldID in wp-content/plugins/gg-polls/template-parts/forms/select.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gg-polls/templates/archive-poll.php:3
    • > PHP Notice
      Undefined variable: fieldName in wp-content/plugins/gg-polls/template-parts/forms/text.php on line 2
    • > PHP Notice
      Undefined variable: fieldValue in wp-content/plugins/gg-polls/template-parts/forms/textarea.php on line 5
    • > PHP Notice
      Undefined variable: fieldTitle in wp-content/plugins/gg-polls/template-parts/forms/img.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/ns-poll-settings.php
    • > Network (severe)
    wp-admin/ns-poll-settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 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: wordpress poll, polling, poll, poll plugin, vote...

gg-polls/ggpolls.php 85% from 13 tests

The main PHP file in "GG Polls" ver. 1.0.9 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: Name the main plugin file the same as the plugin slug ("gg-polls.php" instead of "ggpolls.php")
  • 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,318 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP193581501,724
HTML24953360
PO File17780170
JavaScript565060
CSS31104

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity12.33
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods2463.16%
▷ Protected methods1334.21%
▷ Private methods12.63%
Functions15
▷ Named functions1280.00%
▷ Anonymous functions320.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png51.39KB17.47KB▼ 66.01%
assets/screenshot-1.png29.66KB12.69KB▼ 57.24%
images/image-upload-field.png22.33KB24.19KB0.00%