78% wpuser-certificate

Code Review | WPUser Certificate

WordPress plugin WPUser Certificate scored78%from 54 tests.

About plugin

  • Plugin page: wpuser-certificate
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Oct 8, 2021
  • Latest release: Oct 9, 2021
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: tahahalabi (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

60+ active /2,017 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.43ms] Passed 4 tests

A check of server-side resources used by WPUser Certificate
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.69 ▼4.78
Dashboard /wp-admin3.32 ▲0.0249.35 ▼1.42
Posts /wp-admin/edit.php3.38 ▲0.0251.72 ▲0.22
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.45 ▼11.73
Media Library /wp-admin/upload.php3.25 ▲0.0241.33 ▲0.67
WPUC /wp-admin/admin.php?page=dashboard-setups3.2434.69
Courses /wp-admin/admin.php?page=dashboard-courses3.2133.33
License /wp-admin/admin.php?page=dashboard-license3.2534.91

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WPUser Certificate
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7613.93 ▼0.441.58 ▼0.1840.67 ▼1.37
Dashboard /wp-admin2,227 ▲535.51 ▼0.07108.85 ▲5.6768.55 ▲23.55
Posts /wp-admin/edit.php2,219 ▲1222.67 ▲0.5644.64 ▲9.2142.79 ▲5.53
Add New Post /wp-admin/post-new.php1,575 ▲4721.53 ▼1.59653.95 ▼49.9388.98 ▲28.42
Media Library /wp-admin/upload.php1,507 ▲1105.12 ▲0.96103.23 ▼6.2385.19 ▲35.44
WPUC /wp-admin/admin.php?page=dashboard-setups8232.6533.9822.76
Courses /wp-admin/admin.php?page=dashboard-courses8242.6129.9722.51
License /wp-admin/admin.php?page=dashboard-license8412.5129.7022.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • dashboard_checklicense
    • db_upgraded
    • dashboardplugincertificate_serialkey
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpuser-certificate/pages/templates/wpuc_login.php
    • > /wp-content/plugins/wpuser-certificate/pages/templates/wpuc_dashboard.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wpuser-certificate/pages/backendpages/includes/coursespage/singlecourse.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wpuser-certificate/pages/backendpages/includes/coursespage/courses.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_roles() in wp-content/plugins/wpuser-certificate/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpuser-certificate/functions/plugins_options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_role() in wp-content/plugins/wpuser-certificate/functions/addclientrole.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpuser-certificate/main.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpuser-certificate/functions/addnewusersapi.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpuser-certificate/functions/addnewusers.php:3

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 94% 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
These attributes need to be fixed: The official readme.txt is a good inspiration

wpuser-certificate/main.php 85% from 13 tests

The main PHP file in "WPUser Certificate" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpuser-certificate.php" instead of "main.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,558 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP20330941,059
CSS41710208
Sass1422191
JavaScript63834100

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
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 functions20100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/email.png0.66KB0.44KB▼ 32.89%
images/dashboardcertificateicon.png1.13KB0.94KB▼ 16.74%