74% math-quiz

Code Review | Math Quiz

WordPress plugin Math Quiz scored74%from 54 tests.

About plugin

  • Plugin page: math-quiz
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2
  • WordPress version: 6.3.1
  • First release: Dec 13, 2012
  • Latest release: Aug 16, 2019
  • Number of updates: 92
  • Update frequency: every 26.5 days
  • Top authors: atitan (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /11,793 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Math Quiz
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.92 ▼0.25
Dashboard /wp-admin3.31 ▲0.0142.79 ▼5.28
Posts /wp-admin/edit.php3.36 ▲0.0044.92 ▼2.58
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.59 ▼5.48
Media Library /wp-admin/upload.php3.23 ▲0.0033.99 ▼3.37
Math Quiz /wp-admin/options-general.php?page=math-quiz-menu3.2029.33

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: 1 new table, 7 new options
New tables
wp_math_quiz_problems
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
math-quiz-setting
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Math Quiz
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲11213.58 ▼0.795.02 ▲2.9143.17 ▼1.17
Dashboard /wp-admin2,213 ▲284.85 ▼0.0699.53 ▼17.1239.52 ▼8.66
Posts /wp-admin/edit.php2,093 ▲12.02 ▼0.0133.41 ▼2.7432.72 ▼7.52
Add New Post /wp-admin/post-new.php1,517 ▲317.80 ▲0.30668.86 ▲11.5857.35 ▼3.22
Media Library /wp-admin/upload.php1,386 ▼54.19 ▲0.0197.20 ▼15.2242.97 ▼6.77
Math Quiz /wp-admin/options-general.php?page=math-quiz-menu9622.0221.6529.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_math_quiz_problems
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • math-quiz-setting

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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/math-quiz/math-quiz.php
    • > /wp-content/plugins/math-quiz/admin.php

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Donate link: Invalid url: ""
The official readme.txt might help

math-quiz/math-quiz.php Passed 13 tests

The main file in "Math Quiz" v. 2.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
48 characters long description:
Generating random math problem for comment form.

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin775 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP29271463
PO File3135128312

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions1890.00%
▷ Anonymous functions210.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/background.png178.06KB73.12KB▼ 58.94%