10% training-tools

Code Review | Training Tools Beta

WordPress plugin Training Tools Beta scored10%from 54 tests.

About plugin

  • Plugin page: training-tools
  • Plugin version: 0.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.3.0
  • WordPress version: 6.3.1
  • First release: Sep 10, 2015
  • Latest release: Sep 10, 2015
  • Number of updates: 3
  • Update frequency: every 185.7 days
  • Top authors: WebTechGlobal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /700 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/training-tools/classes/class-trainingtools.php+440
    count(): Parameter must be an array or an object that implements Countable

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

Analyzing server-side resources used by Training Tools Beta
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.22 ▼50.21
Dashboard /wp-admin2.10 ▼1.205.74 ▼40.71
Posts /wp-admin/edit.php2.10 ▼1.255.91 ▼40.99
Add New Post /wp-admin/post-new.php2.10 ▼3.785.25 ▼82.19
Media Library /wp-admin/upload.php2.10 ▼1.135.05 ▼29.86
All Page Guides /wp-admin/edit.php?post_type=ttpageguides2.105.33
Plugins Dashboard /wp-admin/admin.php?page=trainingtools2.105.75
Create /wp-admin/post-new.php?post_type=ttpageguides2.107.29
UI Help Content /wp-admin/admin.php?page=trainingtools_tablepages2.106.04

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 85 new files
Database: 8 new tables, 13 new options
New tables
wp_tt_formsmeta
wp_tt_inputsmeta
wp_tt_postboxes
wp_webtechglobal_projects
wp_tt_pagesmeta
wp_tt_forms
wp_tt_postboxesmeta
wp_tt_pages
New WordPress options
widget_recent-comments
trainingtools_schedule
trainingtools_installeddate
theysaidso_admin_options
trainingtools_formvalidation
trainingtools_installedversion
can_compress_scripts
widget_theysaidso_widget
trainingtools_is_installed
trainingtools_settings
...

Browser metrics Passed 4 tests

A check of browser resources used by Training Tools Beta
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲12413.25 ▼1.134.48 ▲2.2040.88 ▼13.53
Dashboard /wp-admin2,260 ▲725.83 ▼0.0797.20 ▼18.3638.69 ▼3.56
Posts /wp-admin/edit.php2,143 ▲542.06 ▲0.0238.98 ▲2.6334.57 ▲0.49
Add New Post /wp-admin/post-new.php1,578 ▲5023.36 ▲0.04615.97 ▼22.6850.07 ▲0.40
Media Library /wp-admin/upload.php1,445 ▲634.17 ▼0.0193.69 ▼5.2842.14 ▲0.52
All Page Guides /wp-admin/edit.php?post_type=ttpageguides1,1041.9630.3933.87
Plugins Dashboard /wp-admin/admin.php?page=trainingtools3,57111.33202.69118.51
Create /wp-admin/post-new.php?post_type=ttpageguides2,3007.57165.1464.92
UI Help Content /wp-admin/admin.php?page=trainingtools_tablepages1,0811.9931.9027.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/training-tools/classes/class-trainingtools.php+440
    count(): Parameter must be an array or an object that implements Countable
  • The plugin did not uninstall successfully, leaving 8 tables in the database
    • wp_tt_forms
    • wp_tt_postboxesmeta
    • wp_tt_pages
    • wp_tt_formsmeta
    • wp_tt_pagesmeta
    • wp_webtechglobal_projects
    • wp_tt_postboxes
    • wp_tt_inputsmeta
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • trainingtools_is_installed
    • widget_recent-comments
    • theysaidso_admin_options
    • trainingtools_schedule
    • trainingtools_installeddate
    • widget_recent-posts
    • widget_theysaidso_widget
    • trainingtools_installedversion
    • trainingtools_formvalidation
    • can_compress_scripts
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 117 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trainingtools_tablepages
    • > Warning in wp-content/plugins/training-tools/classes/class-trainingtools.php+440
    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=trainingtools_tablepages
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trainingtools
    • > Notice in wp-content/plugins/training-tools/classes/class-ui.php+162
    Undefined index: viewtitle
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trainingtools
    • > Notice in wp-content/plugins/training-tools/classes/class-ui.php+141
    Undefined index: tabs
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trainingtools
    • > Warning in wp-content/plugins/training-tools/classes/class-ui.php+141
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/post-new.php?post_type=ttpageguides
    • > Warning in wp-includes/class-wp-hook.php+312
    call_user_func_array() expects parameter 1 to be a valid callback, function 'trainingtools_save_meta_boxes_pageguides' not found or invalid function name

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 30× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/training-tools/classes/class-categories.php
    • > /wp-content/plugins/training-tools/views/main.php
    • > /wp-content/plugins/training-tools/views/buildpageguides.php
    • > /wp-content/plugins/training-tools/classes/class-install.php
    • > /wp-content/plugins/training-tools/classes/class-trainingtools.php
    • > /wp-content/plugins/training-tools/classes/class-webtechglobal.php
    • > /wp-content/plugins/training-tools/views/formhelp.php
    • > /wp-content/plugins/training-tools/classes/class-view.php
    • > /wp-content/plugins/training-tools/classes/class-phplibrary.php
    • > /wp-content/plugins/training-tools/posttypes/pageguides.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'TRAININGTOOLS_UI' not found in wp-content/plugins/training-tools/classes/class-forms.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trainingtools_tablepages
    • > Network (severe)
    wp-content/plugins/trainingtools/css/admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trainingtools_tablepages
    • > Network (severe)
    wp-content/plugins/trainingtools/css/notifications.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=trainingtools
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=trainingtools
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === training-tools === )
  • Screenshots: These screenshots require images: #1 (Screenshot one.), #2 (Screenshot two.), #3 (Screenshot three.)
Please take inspiration from this readme.txt

training-tools/trainingtools.php 85% from 13 tests

The principal PHP file in "Training Tools Beta" v. 0.0.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("training-tools.php" instead of "trainingtools.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 plugin9,767 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP372,1856,3677,781
PO File16231,3881,339
CSS39349615
JavaScript2113932

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity38.94
▷ Minimum class complexity1.00
▷ Maximum class complexity244.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes13.12%
▷ Concrete classes3196.88%
▷ Final classes00.00%
Methods520
▷ Static methods50.96%
▷ Public methods50597.12%
▷ Protected methods142.69%
▷ Private methods10.19%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants3394.29%
▷ Class constants25.71%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
27 PNG files occupy 2.12MB with 2.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/video-icon.png29.27KB0.64KB▼ 97.82%
images/trash-icon.png29.53KB1.05KB▼ 96.43%
images/warning_large.png52.42KB4.12KB▼ 92.14%
images/success_large.png63.58KB5.66KB▼ 91.09%
images/info-icon.png29.12KB1.12KB▼ 96.14%