78% khan-exercises

Code Review | Khan Exercises for WordPress

WordPress plugin Khan Exercises for WordPress scored 78% from 54 tests.

About plugin

  • Plugin page: khan-exercises
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7.0-3.4
  • WordPress version: 6.3.1
  • First release: Nov 4, 2012
  • Latest release: Nov 12, 2012
  • Number of updates: 43
  • Update frequency: every 0.3 days
  • Top authors: psimakov (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,949 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.82ms] Passed 4 tests

A check of server-side resources used by Khan Exercises for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.58 ▲0.52
Dashboard /wp-admin3.35 ▲0.0559.57 ▼3.55
Posts /wp-admin/edit.php3.40 ▲0.0561.26 ▲5.48
Add New Post /wp-admin/post-new.php5.93 ▲0.05107.24 ▲2.69
Media Library /wp-admin/upload.php3.27 ▲0.0536.75 ▼2.94
Khan Exercises /wp-admin/options-general.php?page=khan-exercises3.2238.41

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

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

Browser metrics Passed 4 tests

Khan Exercises for WordPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.74 ▲0.341.89 ▼0.3045.31 ▼7.15
Dashboard /wp-admin2,201 ▲164.85 ▼0.09123.55 ▼31.2054.12 ▼3.30
Posts /wp-admin/edit.php2,096 ▲42.06 ▲0.0248.20 ▲3.9942.00 ▲3.58
Add New Post /wp-admin/post-new.php1,536 ▲12521.17 ▲3.29733.22 ▲138.1368.56 ▲6.72
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.00105.59 ▼7.3049.81 ▼3.21
Khan Exercises /wp-admin/options-general.php?page=khan-exercises9431.9928.1635.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=khan-exercises
    • > Notice in wp-content/plugins/khan-exercises/khan-exercises.php+387
    Undefined variable: json
    • > GET request to /wp-admin/options-general.php?page=khan-exercises
    • > Notice in wp-content/plugins/khan-exercises/khan-exercises.php+391
    Undefined variable: identifier

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/khan-exercises/khan-exercises.php:185

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (An example of exercise in a standard WordPress theme), #2 (A list of all available Khan Exercises - over 400 exercises!), #3 (An example exercise hosted in a WordPress blog, but embedded via an `iframe` into another blog at blogger.com), #4 (Plugin settings page)
You can look at the official readme.txt

khan-exercises/khan-exercises.php Passed 13 tests

Analyzing the main PHP file in "Khan Exercises for WordPress" version 1.1
56 characters long description:
Brings Khan Academy exercises into your WordPress blogs.

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
Success! There were no dangerous files found in this plugin129,630 lines of code in 774 files:
LanguageFilesBlank linesComment linesLines of code
HTML4355,33160160,952
JavaScript3048,8019,38853,737
CSS37534998,180
SVG21005,971
PHP27471315
Python2476159
Ruby2287152
TeX1335121
Bourne Shell17020
Markdown213019
make1004

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
26 PNG files occupy 0.20MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
khan-exercises/images/previous-step.png0.46KB0.46KB0.00%
khan-exercises/images/avatars/questionmark.png1.66KB1.86KB0.00%
khan-exercises/images/meteorite-small.png2.55KB1.87KB▼ 26.45%
khan-exercises/images/avatars/mr-pink.png13.58KB7.01KB▼ 48.42%
khan-exercises/images/avatars/robot_male_3.png16.56KB6.84KB▼ 58.67%