52% exam-matrix

Code Review | Exam Matrix

WordPress plugin Exam Matrix scored52%from 54 tests.

About plugin

  • Plugin page: exam-matrix
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Dec 21, 2013
  • Latest release: Feb 17, 2014
  • Number of updates: 24
  • Update frequency: every 14.4 days
  • Top authors: Udit Rawat (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

20+ active /10,966 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.44MB] [CPU: ▼55.12ms] Passed 4 tests

Analyzing server-side resources used by Exam Matrix
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.56 ▼0.9112.69 ▼33.21
Dashboard /wp-admin2.57 ▼0.7314.36 ▼45.59
Posts /wp-admin/edit.php2.57 ▼0.7913.60 ▼42.61
Add New Post /wp-admin/post-new.php2.57 ▼3.3213.64 ▼99.05
Media Library /wp-admin/upload.php2.57 ▼0.6613.83 ▼22.88
Import Export /wp-admin/admin.php?page=ex_import_export2.5714.78
Category /wp-admin/edit-tags.php?taxonomy=ex_categories&post_type=ex_test2.5713.16
Q Set /wp-admin/admin.php?page=ex_qset2.5713.94
All Test /wp-admin/edit.php?post_type=ex_test2.5713.05
Add Question /wp-admin/admin.php?page=ex_add_ques2.5712.91
New Test /wp-admin/post-new.php?post_type=ex_test2.5721.21
Search Results /wp-admin/admin.php?page=ex_search_results2.5714.21
Manage Question /wp-admin/admin.php?page=ex_manage_ques2.5712.12

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 34 new files
Database: 6 new tables, 10 new options
New tables
wp_ex_set
wp_ex_subset
wp_ex_result
wp_ex_session
wp_ex_questions
wp_ex_mapping
New WordPress options
widget_theysaidso_widget
exammatrix_db_version
can_compress_scripts
widget_user_login
widget_recent-comments
exammatrix_donation_camp
widget_user_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Exam Matrix
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲19913.74 ▼1.0410.95 ▲9.0642.15 ▼5.37
Dashboard /wp-admin2,251 ▲745.58 ▼0.0693.66 ▲2.1968.27 ▲26.16
Posts /wp-admin/edit.php2,168 ▲681.98 ▼0.0237.14 ▼3.2835.79 ▲0.52
Add New Post /wp-admin/post-new.php1,583 ▲5722.34 ▼0.38731.80 ▲116.5855.59 ▼1.41
Media Library /wp-admin/upload.php1,462 ▲594.22 ▼0.05101.20 ▼3.8665.35 ▲20.26
Import Export /wp-admin/admin.php?page=ex_import_export1,0052.1423.8030.75
Category /wp-admin/edit-tags.php?taxonomy=ex_categories&post_type=ex_test1,3392.1431.6731.14
Q Set /wp-admin/admin.php?page=ex_qset9372.1425.2628.31
All Test /wp-admin/edit.php?post_type=ex_test1,1831.9131.3029.91
Add Question /wp-admin/admin.php?page=ex_add_ques1,7586.78134.61112.85
New Test /wp-admin/post-new.php?post_type=ex_test2,6897.85168.38119.65
Search Results /wp-admin/admin.php?page=ex_search_results8822.1726.6526.90
Manage Question /wp-admin/admin.php?page=ex_manage_ques9692.0124.4530.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/exam-matrix/inc/classes/csv.php+96
    Array and string offset access syntax with curly braces is deprecated
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_ex_result
    • wp_ex_subset
    • wp_ex_questions
    • wp_ex_mapping
    • wp_ex_session
    • wp_ex_set
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_user_login
    • exammatrix_donation_camp
    • widget_user_widget
    • exammatrix_db_version
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 126 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ex_manage_ques
    • > Deprecated in wp-content/plugins/exam-matrix/inc/classes/csv.php+410
    Array and string offset access syntax with curly braces is deprecated
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ex_manage_ques
    • > Notice in wp-content/plugins/exam-matrix/inc/pages/manageq.php+28
    Undefined variable: alert
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ex_manage_ques
    • > Notice in wp-content/plugins/exam-matrix/inc/pages/manageq.php+28
    Trying to access array offset on value of type null
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ex_manage_ques
    • > Notice in wp-content/plugins/exam-matrix/inc/pages/manageq.php+61
    Undefined variable: subset
    • > GET request to /wp-admin/admin.php?page=ex_qset
    • > Warning in wp-content/plugins/exam-matrix/inc/pages/qtest.php+98
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ex_manage_ques
    • > Warning in wp-content/plugins/exam-matrix/inc/pages/manageq.php+61
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=ex_search_results
    • > Notice in wp-content/plugins/exam-matrix/inc/pages/search-results.php+63
    Undefined variable: tests
    • > GET request to /wp-admin/admin.php?page=ex_search_results
    • > Notice in wp-content/plugins/exam-matrix/inc/pages/search-results.php+99
    Undefined variable: detail

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/exam-matrix/lib/php-formhelper/example.php
    • > /wp-content/plugins/exam-matrix/inc/pages/search-results.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/exam-matrix/inc/pages/search-results.php on line 32
    • > PHP Notice
      Undefined variable: detail in wp-content/plugins/exam-matrix/inc/pages/search-results.php on line 99
    • > PHP Fatal error
      Uncaught Error: Call to a member function getAllSet() on null in wp-content/plugins/exam-matrix/inc/pages/addq.php:9
    • > PHP Notice
      Undefined variable: db in wp-content/plugins/exam-matrix/inc/pages/addq.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/exam-matrix/inc/widget/user-widget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to a member function getRecentQuestions() on null in wp-content/plugins/exam-matrix/inc/pages/manageq.php:12
    • > PHP Notice
      Undefined variable: db in wp-content/plugins/exam-matrix/inc/pages/manageq.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function getExampleCSV() on null in wp-content/plugins/exam-matrix/inc/pages/import-export.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/exam-matrix/inc/pages/donation.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ExamMatrix\\register_activation_hook() in wp-content/plugins/exam-matrix/exam-matrix.php:24

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

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === exam-matrix === )
  • Donate link: Invalid url: ""
You can look at the official readme.txt

exam-matrix/exam-matrix.php Passed 13 tests

"Exam Matrix" version 1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
20 characters long description:
Emerico Web Solution

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin4,438 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP21961862,982
JavaScript371480912
CSS33641540
Markdown1204

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity42.27
▷ Minimum class complexity2.00
▷ Maximum class complexity186.00
Average method complexity4.49
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods130
▷ Static methods53.85%
▷ Public methods12394.62%
▷ Protected methods00.00%
▷ Private methods75.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/noimage.png10.38KB5.26KB▼ 49.32%
images/exam.png3.42KB0.91KB▼ 73.42%