10% wpcues-basic-quiz

Code Review | WpCues Basic Quiz

WordPress plugin WpCues Basic Quiz scored10%from 54 tests.

About plugin

  • Plugin page: wpcues-basic-quiz
  • Plugin version: 1.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2015
  • Latest release: May 7, 2015
  • Number of updates: 98
  • Update frequency: every 0.6 days
  • Top authors: wpcues (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

10+ active /4,800 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Compile error in wp-content/plugins/wpcues-basic-quiz/common/classes/wpcue_basic_badge.php+120
    'continue' not in the 'loop' or 'switch' context

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.35ms] Passed 4 tests

Server-side resources used by WpCues Basic Quiz
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.54 ▼2.51
Dashboard /wp-admin3.31 ▲0.0043.54 ▼2.44
Posts /wp-admin/edit.php3.36 ▲0.0045.02 ▲2.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0077.72 ▼19.33
Media Library /wp-admin/upload.php3.23 ▲0.0032.14 ▼1.10

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 221 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WpCues Basic Quiz
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.28 ▼1.392.15 ▲0.2648.42 ▲6.27
Dashboard /wp-admin2,206 ▲154.87 ▼0.12107.91 ▲6.4039.52 ▼2.67
Posts /wp-admin/edit.php2,086 ▼32.01 ▲0.0239.12 ▼0.3434.19 ▼2.80
Add New Post /wp-admin/post-new.php1,528 ▼823.37 ▲0.04629.73 ▲42.1252.59 ▲6.06
Media Library /wp-admin/upload.php1,382 ▼94.17 ▼0.0295.02 ▼2.1944.11 ▲1.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 79× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WpCueBasicQuestion' not found in wp-content/plugins/wpcues-basic-quiz/common/classes/wpcue_basic_singlecor.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WpCueBasicQuestion' not found in wp-content/plugins/wpcues-basic-quiz/common/classes/wpcue_basic_sort.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpcues-basic-quiz/admin/templates/edit-certificate-form.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_Object' not found in wp-content/plugins/wpcues-basic-quiz/common/lib/stripe/Stripe/List.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wpcues-basic-quiz/admin/templates/progresscreen.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpcues-basic-quiz/admin/templates/addnewsection.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wpcues-basic-quiz/admin/templates/edit-badge-form.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'WpCueQuiz_Base' not found in wp-content/plugins/wpcues-basic-quiz/admin/classes/wpcue_quiz_action.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WpCueQuiz_Base' not found in wp-content/plugins/wpcues-basic-quiz/common/classes/wpcue_basic_quiz.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wpcues-basic-quiz/admin/templates/quiz_submit_box.php:1

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

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (List of your quizzes with shortcodes for embedding in posts or pages), #2 (The form for creating and editing a quiz), #3 (The form to add / edit question), #4 (The form to add new grade)
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt might help

wpcues-basic-quiz/index.php 92% from 13 tests

This is the main PHP file of "WpCues Basic Quiz" version 1.6.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpcues-basic-quiz.php" instead of "index.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wpcues-basic-quiz/common/lib/stripe/data/ca-certificates.crt
35,793 lines of code in 186 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript703,3083,37516,959
PHP8650499710,891
CSS92312715,387
Markdown779302,166
JSON1130334
HTML27750
make1426

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.85
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes64
▷ Abstract classes69.38%
▷ Concrete classes5890.62%
▷ Final classes00.00%
Methods501
▷ Static methods8416.77%
▷ Public methods40681.04%
▷ Protected methods6412.77%
▷ Private methods316.19%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants19
▷ Global constants736.84%
▷ Class constants1263.16%
▷ Public constants12100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.72MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
common/css/images/ui-icons_454545_256x240.png6.84KB4.23KB▼ 38.18%
screenshot-4.png73.76KB34.25KB▼ 53.57%
common/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.34KB0.21KB▼ 38.24%
common/css/images/ui-bg_glass_95_fef1ec_1x400.png0.40KB0.17KB▼ 55.80%
common/css/images/ui-bg_glass_75_e6e6e6_1x400.png0.33KB0.18KB▼ 43.58%