84% polls-surveys-contests-and-quizzes-for-pages

Code Review | Polls, Surveys, Contests and Quizzes for Pages

WordPress plugin Polls, Surveys, Contests and Quizzes for Pages scored84%from 54 tests.

About plugin

  • Plugin page: polls-surveys-con...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Jan 4, 2021
  • Latest release: Jan 31, 2022
  • Number of updates: 12
  • Update frequency: every 33.3 days
  • Top authors: pomartel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,662 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.70ms] Passed 4 tests

Server-side resources used by Polls, Surveys, Contests and Quizzes for Pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0639.00 ▼6.60
Dashboard /wp-admin3.36 ▲0.0555.10 ▲3.56
Posts /wp-admin/edit.php3.47 ▲0.1149.20 ▼3.43
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.01 ▼13.56
Media Library /wp-admin/upload.php3.28 ▲0.0539.54 ▲0.79

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Polls, Surveys, Contests and Quizzes for Pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲7514.20 ▼0.371.70 ▲0.0141.44 ▼4.49
Dashboard /wp-admin2,242 ▲655.57 ▼0.0792.88 ▲2.7140.63 ▼5.65
Posts /wp-admin/edit.php2,147 ▲422.02 ▲0.0238.18 ▼0.2738.16 ▼0.53
Add New Post /wp-admin/post-new.php6,242 ▲4,71618.98 ▼4.60926.52 ▲227.3663.77 ▲4.50
Media Library /wp-admin/upload.php1,441 ▲444.19 ▲0.07101.87 ▼17.2047.46 ▼2.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/polls-surveys-contests-and-quizzes-for-pages/partials/classic_modal.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/polls-surveys-contests-and-quizzes-for-pages/pscq.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/polls-surveys-contests-and-quizzes-for-pages/partials/classic_button.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: contest, quiz, poll, survey

polls-surveys-contests-and-quizzes-for-pages/pscq.php 85% from 13 tests

"Polls, Surveys, Contests and Quizzes for Pages" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("polls-surveys-contests-and-quizzes-for-pages.php" instead of "pscq.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin610 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PO File58060220
PHP62512166
JavaScript2122141
CSS212082
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity1.67
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin