10% level-system

Code Review | Level system

WordPress plugin Level system scored10%from 54 tests.

About plugin

  • Plugin page: level-system
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2018
  • Latest release: Feb 22, 2019
  • Number of updates: 23
  • Update frequency: every 7.9 days
  • Top authors: sublimelinks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /710 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/level-system/includes/class-level_system-widgets.php+151
    Function create_function() is deprecated

Server metrics [RAM: ▼1.90MB] [CPU: ▼50.74ms] Passed 4 tests

A check of server-side resources used by Level system
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.387.01 ▼38.33
Dashboard /wp-admin2.10 ▼1.207.39 ▼40.93
Posts /wp-admin/edit.php2.11 ▼1.258.58 ▼40.76
Add New Post /wp-admin/post-new.php2.10 ▼3.787.67 ▼82.94
Media Library /wp-admin/upload.php2.10 ▼1.127.44 ▼30.40
WP Level System /wp-admin/options-general.php?page=level_system2.115.72

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_level_system_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Level system
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲16513.68 ▼0.6912.19 ▲10.6148.90 ▲10.81
Dashboard /wp-admin2,209 ▲295.59 ▼0.0690.04 ▲3.1545.00 ▲0.97
Posts /wp-admin/edit.php2,117 ▲172.03 ▲0.0843.73 ▼1.2139.94 ▼1.90
Add New Post /wp-admin/post-new.php1,692 ▲16622.36 ▼0.80604.34 ▼102.2661.73 ▲0.89
Media Library /wp-admin/upload.php1,417 ▲174.19 ▲0.00115.00 ▲18.6253.26 ▲13.50
WP Level System /wp-admin/options-general.php?page=level_system1,3733.5775.3737.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/level-system/includes/class-level_system-widgets.php+151
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_level_system_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > Deprecated in wp-content/plugins/level-system/includes/class-level_system-widgets.php+151
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prefix_bootstrap handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prefix_bootstrap handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prefix_bootstrap handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prefix_bootstrap handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > Notice in wp-content/plugins/level-system/admin/partials/level-system-admin-display.php+31
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/level-system/public/partials/level_system-public-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/level-system/includes/class-level_system-widgets.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/level-system/admin/partials/level-system-admin-display.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=level_system
    • > Javascript (severe) in unknown
    http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js?ver=6.3.1 5:215 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

level-system/level_system.php 77% from 13 tests

"Level system" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Description: Please don't use more than 140 characters for the plugin description (currently 377 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("level-system.php" instead of "level_system.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected503 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14214592471
CSS32819
JavaScript275413

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin