10% easy-quiz

Code Review | Easy Quiz

WordPress plugin Easy Quiz scored10%from 54 tests.

About plugin

  • Plugin page: easy-quiz
  • Plugin version: 5.00
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: Sep 15, 2012
  • Latest release: Aug 1, 2017
  • Number of updates: 67
  • Update frequency: every 26.6 days
  • Top authors: manojtd (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /12,443 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/easy-quiz/EzOptions.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; EzBaseOption has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼59.15ms] Passed 4 tests

An overview of server-side resources used by Easy Quiz
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.185.27 ▼40.35
Dashboard /wp-admin2.30 ▼1.047.02 ▼59.76
Posts /wp-admin/edit.php2.30 ▼1.056.12 ▼41.82
Add New Post /wp-admin/post-new.php2.30 ▼3.586.05 ▼94.65
Media Library /wp-admin/upload.php2.30 ▼0.937.50 ▼32.98

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Quiz
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.41 ▼0.211.79 ▼0.1738.85 ▼3.75
Dashboard /wp-admin2,222 ▲225.85 ▼0.03106.39 ▼1.2140.44 ▼3.08
Posts /wp-admin/edit.php2,101 ▼22.03 ▼0.0138.69 ▲2.7836.74 ▼9.17
Add New Post /wp-admin/post-new.php1,548 ▲323.25 ▲0.16615.66 ▼23.0553.80 ▼4.67
Media Library /wp-admin/upload.php1,404 ▲74.15 ▼0.09113.49 ▲13.9649.15 ▲4.56
Easy Quiz Lite /wp-admin/easy-quiz.php260.440.1314.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/easy-quiz/EzOptions.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; EzBaseOption has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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 take a closer look at the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/easy-quiz/myPlugins.php:300
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/easy-quiz/EzOptions.php:544
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-quiz/ezDenyLite.php on line 22
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/easy-quiz/ezDenyLite.php on line 22
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/easy-quiz/ezDenyLite.php on line 22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/easy-quiz.php
    • > Network (severe)
    wp-admin/easy-quiz.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Sample quiz.), #2 (Color customization.)
The official readme.txt is a good inspiration

easy-quiz/easy-quiz.php 92% from 13 tests

The primary PHP file in "Easy Quiz" version 5.00 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 146 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin4,114 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript21062052,018
PHP5250791,967
CSS107129

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity11.59
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods101100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.17MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png126.46KB34.41KB▼ 72.79%
img/ezpaypal.png9.22KB3.44KB▼ 62.72%
img/ezsupport.png3.13KB2.01KB▼ 35.75%
screenshot-1.png21.01KB7.82KB▼ 62.80%
ezsupport.png3.13KB2.01KB▼ 35.75%